Lovelylou79
New Member
- Joined
- Sep 4, 2017
- Messages
- 37
Hi Folks,
I have a basic Loop and If statement fr populatnga Tasks/Roster type sheet.
Currently, the code will populate fields based on the value in the range.
What I would like to do, is if the offset cell is not blank, for the next blank cell to be populated instead.
I have tried a number of ways to do this, but they are all bulky.
I would greatly appreciate some assistance. Thanks!
Dim i As Integer
For ii = 2 To 11
For i = 4 To 6
If InStr(1, (Cells(i, ii).Value), "BANK") > 0 Then
Cells(i, ii).Offset(3, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(6, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(9, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(12, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(15, 0).Value = "1330 - Payment Release"
'New Week
Cells(i, ii).Offset(26, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(29, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(32, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(35, 0).Value = "1330 - Payment Release"
'2nd Friday
Cells(i, ii).Offset(38, 0).Value = "1100 - Payment Release"
Cells(i, ii).Offset(39, 0).Value = "1300 - Payment Release"
End If
Next i
Next ii
I have a basic Loop and If statement fr populatnga Tasks/Roster type sheet.
Currently, the code will populate fields based on the value in the range.
What I would like to do, is if the offset cell is not blank, for the next blank cell to be populated instead.
I have tried a number of ways to do this, but they are all bulky.
I would greatly appreciate some assistance. Thanks!
Dim i As Integer
For ii = 2 To 11
For i = 4 To 6
If InStr(1, (Cells(i, ii).Value), "BANK") > 0 Then
Cells(i, ii).Offset(3, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(6, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(9, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(12, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(15, 0).Value = "1330 - Payment Release"
'New Week
Cells(i, ii).Offset(26, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(29, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(32, 0).Value = "1330 - Payment Release"
Cells(i, ii).Offset(35, 0).Value = "1330 - Payment Release"
'2nd Friday
Cells(i, ii).Offset(38, 0).Value = "1100 - Payment Release"
Cells(i, ii).Offset(39, 0).Value = "1300 - Payment Release"
End If
Next i
Next ii
Last edited: