Hi all,
I have a small issue i am sure one of you will solve extremely quickly.
In each row in column A I have a start date and in each row in column B I have an end date (no set number of rows). What I want is for the list of dates between these 2 dates to be listed in the corresponding cell in column C.
I have code to do row 1 which works perfectly (see below) but this does not loop ( I want it to loop until it reaches a blank cell).
Your help would be hugely appreciated.Sub WriteDates() Dim sc As Range sd = Range("A1") ' start date ed = Range("B1") ' end date Set sc = Range("C1") ' start cell ' check dates If ed - sd <= 0 Then Exit Sub j = 0 For i = sd To ed sc.Offset(j, 0) = i j = j + 1 Next i End Sub
Many thanks, matt
sorry mods please delete this. realise i posted it in wrong section. 1st timer.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks