Greetings,
I have a macro that I would like to use to convert date values in columns of data. I would like to be able to set the column value to convert with the integer variable 'a'.
The material inside the with statement is not functioning. I have two questions.
1)How do I set the output style of the DateValue function to 'MM/DD/YYYY'?
2)How is best to loop through the column with values to convert? I would like to convert them so that the output is placed in the same cell as the input contents. Ideas?
Thanks,
I have a macro that I would like to use to convert date values in columns of data. I would like to be able to set the column value to convert with the integer variable 'a'.
The material inside the with statement is not functioning. I have two questions.
1)How do I set the output style of the DateValue function to 'MM/DD/YYYY'?
2)How is best to loop through the column with values to convert? I would like to convert them so that the output is placed in the same cell as the input contents. Ideas?
Thanks,
Code:
Sub SAVE_MACRO_Date_Convert()
Dim a As Integer
Dim b As Integer
Dim c As Long
Dim Var1 As Variant
'column value to convert
a = 4
b = Cells(Rows.Count, a).End(xlUp).Row
With ActiveSheet
For c = 2 To b
Var1 = DateValue(CStr(.Cells(c, a))) ' not sure how to output values in the same location as the input source
Next c
'.NumberFormat = "mm/dd/yyyy"
End With
End Sub