silentwolf
Well-known Member
- Joined
- May 14, 2008
- Messages
- 1,216
- Office Version
- 2016
Hi guys,
I am not able to get this simple code running..
all those things I tried but no luck to get the dates filled from "B5") for the first date down to the last date.
As I am sure it is simple but I can not get it to run correctly.
Maybe someone can help.
Thanks
I am not able to get this simple code running..
Code:
Sub FillDates()
Dim datStart As Date
Dim datEnd As Date
Dim row As Long
datStart = Range("E1").value
datEnd = Range("E2").value
For row = 5 To datEnd - datStart
' Cells(row, 2) = datStart + row - 1
' Cells(row, 2) = datStart - 1
' Cells(row, 2) = datStart + 1
Cells(row, 2) = datStart + 1
Next row
End Sub
all those things I tried but no luck to get the dates filled from "B5") for the first date down to the last date.
As I am sure it is simple but I can not get it to run correctly.
Maybe someone can help.
Thanks