Hi guys - here's my issue. Creating a Macro to convert a standard 8digit numeric into date format per below. What I'd like to do is change the 'range', 'columns', 'selection' to be a generic variety to be used in any cell/range/selection
macro should format cell directly to the left, then fill down
can anyone help me with the code? many thanks
Sub AS400_Date_Format()
'
' AS400_Date_Format Macro
' Format 8 digit AS400 date
'
' Keyboard Shortcut: Ctrl+Shift+D
'
Selection.NumberFormat = "m/d/yyyy"
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]=99999999,DATE(2222,2,2),DATE(LEFT(RC[-1],4),MID(RC[-1],5,2),RIGHT(RC[-1],2)))"
Range("BA2").Select
Columns("BA:BA").ColumnWidth = 9.43
Selection.AutoFill Destination:=Range("BA2:BA3940")
Range("BA2:BA3940").Select
End Sub
macro should format cell directly to the left, then fill down
can anyone help me with the code? many thanks
Sub AS400_Date_Format()
'
' AS400_Date_Format Macro
' Format 8 digit AS400 date
'
' Keyboard Shortcut: Ctrl+Shift+D
'
Selection.NumberFormat = "m/d/yyyy"
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]=99999999,DATE(2222,2,2),DATE(LEFT(RC[-1],4),MID(RC[-1],5,2),RIGHT(RC[-1],2)))"
Range("BA2").Select
Columns("BA:BA").ColumnWidth = 9.43
Selection.AutoFill Destination:=Range("BA2:BA3940")
Range("BA2:BA3940").Select
End Sub