Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using the following code to reformat dates in 3 different columns,
for example, Column T goes from 2070126 to 01/26/2007. What I'd like to do is add something to it that will check each column first to make sure it hasnt already been reformatted. Any ideas? Sub CleanUp_Data_File() Application.ScreenUpdating = False With ActiveSheet ' ~~ Reformat Column P ~~ Columns("P:P").Insert Range("P3:P" & Range("Q65536").End(xlUp).Row).FormulaR1C1 = _ "=MID(RC[1],5,2)&""-""&MID(RC[1],1,3)&""-""&MID(RC[1],8,4)" Range("P3:P" & Range("P65536").End(xlUp).Row).Copy Range("Q3").PasteSpecial xlPasteValues, , False, False Columns("P:P").EntireColumn.Delete ' ~~ Reformat Column S ~~ Columns("S:S").Insert Range("S3:S" & Range("T65536").End(xlUp).Row).FormulaR1C1 = _ "=MID(RC[1],4,2)&""/""&MID(RC[1],6,2)&""/""&""20""&MID(RC[1], 2,2)" Range("S3:S" & Range("S65536").End(xlUp).Row).Copy Range("T3").PasteSpecial xlPasteValues, , False, False Columns("S:S").EntireColumn.Delete ' ~~ Reformat Column T ~~ Columns("T:T").Insert Range("T3:T" & Range("U65536").End(xlUp).Row).FormulaR1C1 = _ "=MID(RC[1],4,2)&""/""&MID(RC[1],6,2)&""/""&""20""&MID(RC[1], 2,2)" Range("T3:T" & Range("T65536").End(xlUp).Row).Copy Range("U3").PasteSpecial xlPasteValues, , False, False Columns("T:T").EntireColumn.Delete End With Application.ScreenUpdating = True End Sub Thanks, -- Dan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clearing Check Boxes & Running a diff Macro when unchecking the ch | Excel Discussion (Misc queries) | |||
How to check a cell for content before running macro. | Excel Programming | |||
How to Check if a Process is Running | Excel Programming | |||
check for running app | Excel Programming | |||
Check for Excel version before running? | Excel Programming |