fadetograham
New Member
- Joined
- Jul 6, 2015
- Messages
- 39
Hi everyone
This has been driving me around the bend and have decided to throw it out into the forum as I've tried numerous connotations, searched high and low for a solution and can't crack it.
What I'm trying to do is populate the cell in column N with 8:00 if the date in column A of that row is a weekend.
The date in column A is in dd/mm/yyyy format.
e.g.
Private Sub wknd()
Dim i As Integer
For i = 6 To 1000
If Cells(i, 1).Value = Weekday("7") Or Weekday("1") Then
Cells(i, 14) = "8:00"
End If
Next
End Sub
This is functioning but inserting 8:00 into every cell regardless of the date in cell (i, 1).
I'm probably missing something small but I just can't find the solution so any help would be really appreciated.
Thanks
Graham
This has been driving me around the bend and have decided to throw it out into the forum as I've tried numerous connotations, searched high and low for a solution and can't crack it.
What I'm trying to do is populate the cell in column N with 8:00 if the date in column A of that row is a weekend.
The date in column A is in dd/mm/yyyy format.
e.g.
Private Sub wknd()
Dim i As Integer
For i = 6 To 1000
If Cells(i, 1).Value = Weekday("7") Or Weekday("1") Then
Cells(i, 14) = "8:00"
End If
Next
End Sub
This is functioning but inserting 8:00 into every cell regardless of the date in cell (i, 1).
I'm probably missing something small but I just can't find the solution so any help would be really appreciated.
Thanks
Graham
Last edited: