#1   Report Post  
tvkodde26
 
Posts: n/a
Default Repeat Macro

I need help in creating a macro that will repeat an easy command. I
have Column A full of numbers, some are formatted General and others
are formatted Text. For Vlookup purposes I need them all formatted as
General.

How would I build a Macro that goes to cell A1 and complete (Enter +
F2) to convert it to general and then it moves to cell A2 and repeats
the same command, etc.....

Thanks for any help.

Travis

  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default Repeat Macro

Hi tvkodde26

If I understand you correct this will work for you?

Columns("A").NumberFormat = "General"




--
Regards Ron de Bruin
http://www.rondebruin.nl


"tvkodde26" wrote in message oups.com...
I need help in creating a macro that will repeat an easy command. I
have Column A full of numbers, some are formatted General and others
are formatted Text. For Vlookup purposes I need them all formatted as
General.

How would I build a Macro that goes to cell A1 and complete (Enter +
F2) to convert it to general and then it moves to cell A2 and repeats
the same command, etc.....

Thanks for any help.

Travis



  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default Repeat Macro


For i = 1 To Cells(Rows.Count,"A").End(xlUp).Row
With Activecell
.Value = .Value
End With
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"tvkodde26" wrote in message
oups.com...
I need help in creating a macro that will repeat an easy command. I
have Column A full of numbers, some are formatted General and others
are formatted Text. For Vlookup purposes I need them all formatted as
General.

How would I build a Macro that goes to cell A1 and complete (Enter +
F2) to convert it to general and then it moves to cell A2 and repeats
the same command, etc.....

Thanks for any help.

Travis



  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default Repeat Macro

Typo

For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
With Cells(i, "A")
.Value = .Value
.NumberFormat = "General"
End With
Next i


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...

For i = 1 To Cells(Rows.Count,"A").End(xlUp).Row
With Activecell
.Value = .Value
End With
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"tvkodde26" wrote in message
oups.com...
I need help in creating a macro that will repeat an easy command. I
have Column A full of numbers, some are formatted General and others
are formatted Text. For Vlookup purposes I need them all formatted as
General.

How would I build a Macro that goes to cell A1 and complete (Enter +
F2) to convert it to general and then it moves to cell A2 and repeats
the same command, etc.....

Thanks for any help.

Travis





  #5   Report Post  
Ron de Bruin
 
Posts: n/a
Default Repeat Macro

Bob understand you <g


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Hi tvkodde26

If I understand you correct this will work for you?

Columns("A").NumberFormat = "General"




--
Regards Ron de Bruin
http://www.rondebruin.nl


"tvkodde26" wrote in message oups.com...
I need help in creating a macro that will repeat an easy command. I
have Column A full of numbers, some are formatted General and others
are formatted Text. For Vlookup purposes I need them all formatted as
General.

How would I build a Macro that goes to cell A1 and complete (Enter +
F2) to convert it to general and then it moves to cell A2 and repeats
the same command, etc.....

Thanks for any help.

Travis







  #6   Report Post  
Harlan Grove
 
Posts: n/a
Default Repeat Macro

tvkodde26 wrote...
I need help in creating a macro that will repeat an easy command. I
have Column A full of numbers, some are formatted General and others
are formatted Text. For Vlookup purposes I need them all formatted as
General.

How would I build a Macro that goes to cell A1 and complete (Enter +
F2) to convert it to general and then it moves to cell A2 and repeats
the same command, etc.....


Formatting doesn't affect contents. Do you mean some of the cells
contain text that looks like numbers and the remaining cells contain
numbers? If so, do you want to permanently convert the cells containing
text into numbers? If so, the simplest way is to select all cells in
col A, run Data Text to Columns, and immediately click the Finish
button.

If you only want lookup formulas to treat all values in col A as
numeric, you could use INDEX/MATCH rather than VLOOKUP. If your
intended formula were =VLOOKUP(x,A1:Z999,y), then use the array formula

=INDEX(A1:Z999,MATCH(x,--A1:A999),y)

If you're using a FALSE or zero 4th argument to VLOOKUP, use a zero 3rd
argument to MATCH in the formula above. Then again, if all values in
your lookup table should be numbers, you could use the array formula

=VLOOKUP(x,--A1:Z999,y)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Repeat a command in a Macro Phil Osman Excel Discussion (Misc queries) 4 June 30th 05 01:23 AM
repeat macro formula to all cells dave glynn Excel Discussion (Misc queries) 8 March 10th 05 08:42 PM
Macro to repeat formulas in next row katiekay Excel Discussion (Misc queries) 5 February 10th 05 08:28 PM
How to program an excel macro to repeat a series of keystrokes? Beancounter Excel Discussion (Misc queries) 8 January 22nd 05 11:51 PM


All times are GMT +1. The time now is 05:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"