Hi Guys,
Trying to solve an issue with my VBA coding skills.
I have a sheet with multiple columns. The raw data I have a date in column "A". With the below procedures I insert a new blank column into "A" pushing everything to the left one column. I then insert "DOW" (meaning Day of Week" into A1. That works fine.
The second part of this code is I want to loop down through this column and if blank (which it will be) it will interpret the date ( formatted 12/22/2020) in column "B" on that row and make the cell in (i,1) equal to the date in (i,2) and make it a word. (example "Mon, Tue, Wed" etc)
When I step through the code I get a syntax error at line " Cells(i,1) = Cells((i,2),(Text,""ddd"")) " and the code stops.
I want it to loop through the entire column which is about 1000 records and add this day notation.
Thank you for reviewing and offering up a solution.
Trying to solve an issue with my VBA coding skills.
I have a sheet with multiple columns. The raw data I have a date in column "A". With the below procedures I insert a new blank column into "A" pushing everything to the left one column. I then insert "DOW" (meaning Day of Week" into A1. That works fine.
The second part of this code is I want to loop down through this column and if blank (which it will be) it will interpret the date ( formatted 12/22/2020) in column "B" on that row and make the cell in (i,1) equal to the date in (i,2) and make it a word. (example "Mon, Tue, Wed" etc)
When I step through the code I get a syntax error at line " Cells(i,1) = Cells((i,2),(Text,""ddd"")) " and the code stops.
I want it to loop through the entire column which is about 1000 records and add this day notation.
Thank you for reviewing and offering up a solution.
VBA Code:
Sub formatsheet()
Dim lrow, i As Long
lrow = Cells(Rows.Count, "B").End(xlUp).Row
i = 2
'Insert into Column A "DOW" and run
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
ActiveCell.Value = "DOW"
Do While i <= lrow
If Cells(i, 1).Value = "" Then
Cells(i,1) = Cells((i,2),(Text,""ddd""))
End Sub