Skip to content

Instantly share code, notes, and snippets.

@gtaing1
Created April 12, 2017 18:36
Show Gist options
  • Select an option

  • Save gtaing1/aecba7fc7bae580dff31bc0b62b48fb0 to your computer and use it in GitHub Desktop.

Select an option

Save gtaing1/aecba7fc7bae580dff31bc0b62b48fb0 to your computer and use it in GitHub Desktop.
Sub DateValueConvert()
'
' DateValueConvert Macro
'
Application.ScreenUpdating = False
Dim lastrow As Long
lastrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
Selection.EntireColumn.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
Range("A2:A" & lastrow).Formula = "=DATEVALUE(RC[1])"
'ActiveCell.FormulaR1C1 = "=DATEVALUE(RC[1])"
'ActiveCell.Select
'Good Below - fix range? - fills the column w/ formula
'Selection.AutoFill Destination:=ActiveCell.Range("A1:A3595")
'Stackoverflow copy - works
'Range(Selection, Selection.End(xlDown)).Select
'Selection.FillDown
'selects and copys columns for da paste
ActiveCell.Range("A1:A" & lastrow).Select
Selection.Copy
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues
ActiveCell.Offset(0, -1).Columns("A:A").EntireColumn.Select
Selection.Delete Shift:=xlToLeft
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment