I want to use VBA code to convert my data (date) from text to date.
For Each c In Range("B4:B" & Range("B" & Rows.Count).End(xlUp).Row)
c.Value = DateValue(c.Value)
Next c
This code is not working with blank cells in between. Showing runtime error (error in datatype). And this code:
For Each c In Range("B4:B" & Range("B" & Rows.Count).End(xlUp).Row)
c.Value = CDate(c.Value)
Next c
is showing 12.00.00 AM for empty values.
Basic idea behind to convert all text to date in given range, when new data is pasted.
Please give suggestions. Thanks