Hello Everyone!
Hope you are safe and sound...
In the column D of the sheet i attached, i have complete dates.
I want to extract only the day and place that day in the same cell as of complete date, replacing the complete dates with day.
and i want to do it for the whole column.
I tried to solve this but type mismatch error arises. Please help...
Sub Formulas()
Const StartRow As Byte = 2
Dim lastrow As Long
Dim r As Long
Dim MyDate As Double
lastrow = Range("B3").CurrentRegion.Rows.Count
For r = StartRow To lastrow
MyDate = VBA.DateTime.Day("D" & r)
Range("D" & r).Value = VBA.DateTime.Day("D" & r)
Next r
End Sub
Please do note that, before using above code i also performed some other functions on this worksheet i.e deleting blank rows through filtering,
For that i wrote another code first, after removing those blank rows, i wanted to change the complete dates in "Posting Date" column with only "Day".
After filtering the blank rows, i have 109 rows, data starting from Row 2.
Bookmarks