Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Repeat a command in a Macro | Excel Discussion (Misc queries) | |||
repeat macro formula to all cells | Excel Discussion (Misc queries) | |||
Macro to repeat formulas in next row | Excel Discussion (Misc queries) | |||
How to program an excel macro to repeat a series of keystrokes? | Excel Discussion (Misc queries) |