Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a data sheet that ocassionally has the lower half values remain as
text when I copy new data. I have produced the following macro to convert the selected cols to either date or number format. There are many more columns to convert to number format than shown. I've trimmed some of the default code entered by the macro recorder to what I think is the minimum required. Is there a more compact version of the code I can use to get the same result. I also wan this to run on cahnges to the sheet (ie; when new data is copied in). Sub ColToNum() Columns("K:K").Select 'number format Selection.TextToColumns , DataType:=xlDelimited, FieldInfo _ :=Array(1, 1) Columns("M:M").Select 'number format Selection.TextToColumns , DataType:=xlDelimited, FieldInfo _ :=Array(1, 1) Columns("Q:Q").Select 'number format Selection.TextToColumns , DataType:=xlDelimited, FieldInfo _ :=Array(1, 1) Columns("R:R").Select 'number format Selection.TextToColumns , DataType:=xlDelimited, FieldInfo _ :=Array(1, 1) Columns("E:E").Select 'date format Selection.TextToColumns , DataType:=xlDelimited, FieldInfo _ :=Array(1, 4) Columns("G:G").Select 'date format Selection.TextToColumns , DataType:=xlDelimited, FieldInfo _ :=Array(1, 4) End Sub Any suggestions appreciated. -- Jim |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2 Cols To 2 Cols VLookup Comparison | Excel Discussion (Misc queries) | |||
How do I perform multiple formating within a single line of text? | Excel Worksheet Functions | |||
conditional formating on rows & cols depending on one cell | Excel Discussion (Misc queries) | |||
Macro for single to multiple cols. Help! | New Users to Excel | |||
Cond Format:re color 2 cols, skip 2 cols | Excel Worksheet Functions |