Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Recording Macros


  • Please log in to reply

#1
ojo

ojo

    New Member

  • Member
  • Pip
  • 3 posts
I have a huge spreadsheet at work w/ a million rows of data. For each cell of a particular row, I need to delete the first 4 characters (which will be different characters for each cell).

I thought I could get a macro to record just my keystrokes - in the case F2, Home, Del, Del, Del, Del, Return. I could then assign that macro to a key, and hit it once to correct a cell and move down to the next one, thus saving myself a ton of typing.

Unfortunately, when I record the macro, it doesn't actually record my keystrokes at all - it remembers the final text (i.e. with the first four characters deleted) of the cell I recorded the macro from, and will paste that text into any cell from which I now run the macro. Obviously this won't do!

Any suggestions on how to record *just keystrokes* in a macro? Or some other method I can use to erase the first four characters in every cell, even if each cell has different text?

Any help appreciated.

Thanks,
ojo
  • 0

Advertisements


#2
stu_design

stu_design

    Member

  • Member
  • PipPipPip
  • 217 posts
you could record a macro to search a range and delete the first 3 characters from each cell

dont know the code off the top of my head

if this helps a bit, good

hopefully this will set u on theay 2 programming

but, if it doesnt help u post back and ill look into it

Stu Design


(oh and u could have put this in the programming dforum, macros do qualify as programming language(VBA))

Edited by stu_design, 02 June 2005 - 11:14 AM.

  • 0

#3
ojo

ojo

    New Member

  • Topic Starter
  • Member
  • Pip
  • 3 posts

you could record a macro to search a range and delete the first 3 characters from each cell


okay .... how do I do that? I've searched the online help but can't find anything about how to do that. sorry to be daft!
  • 0

#4
stu_design

stu_design

    Member

  • Member
  • PipPipPip
  • 217 posts
ok i guess when i looked for ur solution i was going to fast and i realized that the following link(which contain what u are looking for) to only work if you know the exact amount of chacters are in the string

http://www.bettersol...02077132517.htm

like say the data is like as follows

ad298
ad56376
ad2342334
ad2

it wont work because the cells have to have the same length
the code will get rid of the ad(which we want to get rid of), but will insert the characets u want only to the character postion which u set

maybe im just not making any sense

anyyways i think this is what u are looking 4

Stu Design
  • 0

#5
ojo

ojo

    New Member

  • Topic Starter
  • Member
  • Pip
  • 3 posts

ok i guess when i looked for ur solution i was going to fast and i realized that the following link(which contain what u are looking for) to only work if you know the exact amount of chacters are in the string

http://www.bettersol...02077132517.htm

like say the data is like as follows

ad298
ad56376
ad2342334
ad2

it wont work because the cells have to have the same length
the code will get rid of the ad(which we want to get rid of), but will insert the characets u want only to the character postion which u set

maybe im just not making any sense

anyyways i think this is what u are looking 4

Stu Design

View Post



Nope, that won't do it. Thanks for the suggestion though.

Each cell has different text with different lengths. I just need to DELETE the first four characters of each cell. I can't BELIEVE that this is so hard to do in EXCEL. I remember "the good old days" when you could record a Macro and would actually record your keystrokes!! Is that simply impossible to do in VB? Is there no code I can insert that means "delete character" or something?

I have no idea how to program VB, but I'm thinking maybe something that would flow kind of like this

EDIT CELL
DELETE
DELETE
DELETE
DELETE
END EDIT CELL
GO TO NEXT CELL DOWN

does that make sense? surely there's some way to do this????
  • 0

#6
stu_design

stu_design

    Member

  • Member
  • PipPipPip
  • 217 posts
whats the greatest length of one of the cells?

because the solution i helped provide may work

num_chars The number of characters you want to return.


u can jsut tell it to return many many characters
say if the longest length i s500 then tell it to return 501

mayb ethsi can stiil work
Stu Design
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP