Macro's

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a macro that will carry out actions on cells below each
other or side by side automatically. I think it is called creating a loop
macro but not to sure.
At present i have a spread sheet which i input data (copy and paste) from
another application. The data is numeric, but when i paste it into excel is
thinks its a text entry. I have done all the normal stuff but i have to place
the cursor at the end of the data in the cell, press F2 and then backspace.
This is the action i would like to run the macro on as i have to do this in
every cell.

I have create a macro to do this action but it will not allow me to
highlight an area and run it for every cell.

Can anyone help please???
 
For Each cell In selection
'do your stuff
Next cell

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
Thanks Bob, but i'm a bit of a thicky when it comes to this, can you explain
a bit more simply how i would do this....

Thanks again
 
You said that you already had code to do the F2 stuff. Wrap your code in
those two lines, and change references to specific cells/ranges to the cell
object variable.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
I would Format all to General then copy an empty cell.

Select the data range and Edit>Paste Special(in place)>Add>OK>Esc

That will chnage the text to numbers.

No need to F2 and Enter in each cell.

BTW.....macros won't record steps or run while you're in Edit mode.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top