I import transaction data with a date format that excel does not recognize as date but as a number. I use a macro to change it to a useable format. The macro is a loop, as shown below, and I'm wondering is there a way to perform this same task using a With....End With statement? Would that be more efficient? My coding is below.
Dim lDateCount As Long
Dim lCounter As Long
'Set my variables values or range
lDateCount = Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row).Count
Range("A1").Select
For lCounter = 1 To lDateCount
If Len(ActiveCell) = 8 Then ActiveCell.Value = Left(ActiveCell, 2) & "/" & Mid(ActiveCell, 3, 2) & "/" & Right(ActiveCell, 4)
If Len(ActiveCell) = 7 Then ActiveCell.Value = Left(ActiveCell, 1) & "/" & Mid(ActiveCell, 2, 2) & "/" & Right(ActiveCell, 4)
ActiveCell.Offset(1, 0).Activate
Next lCounter
Bookmarks