H
hotherps
IND will only appear in 8 cells per row, and it might not be every row
After 8 cells are found the code should apply the same conditions bu
offset them -1. I can only have IND in four colunms at a time.
When it drops down after the 4 column has eight cells, it should plac
Brk -1 from the next cell that has IND in it.
I also need to know how many cells have "." in them before a cell wit
IND is reached. The scheme will change based on the number of cell
with "." in them. I can't seem to get a counter to do this.
I just need to be able to count the "." before each group of INDS i
found.
Kind of hard to explain..
Thanks
Dim cell As Range, cell1 As Range
Dim bLunchDue As Boolean, bHadLunch As Boolean
Dim l As Integer
Dim i As Integer
For Each cell In Range("G11:G298")
i = 1
bLunchDue = False
bHadLunch = False
' now walk across the row or reference cells in the row.
For Each cell1 In cell.Resize(1, 96 - 7)
If Application.CountIf(cell1.Resize(1, 8), "IND") = 8 Then
If bLunchDue Then
cell1.Offset(0, 8).Value = "lun"
bLunchDue = False
bHadLunch = True
Else
cell1.Offset(0, 8).Value = "brk"
If Not bHadLunch Then bLunchDue = True
End If
End If
Next
Nex
After 8 cells are found the code should apply the same conditions bu
offset them -1. I can only have IND in four colunms at a time.
When it drops down after the 4 column has eight cells, it should plac
Brk -1 from the next cell that has IND in it.
I also need to know how many cells have "." in them before a cell wit
IND is reached. The scheme will change based on the number of cell
with "." in them. I can't seem to get a counter to do this.
I just need to be able to count the "." before each group of INDS i
found.
Kind of hard to explain..
Thanks
Dim cell As Range, cell1 As Range
Dim bLunchDue As Boolean, bHadLunch As Boolean
Dim l As Integer
Dim i As Integer
For Each cell In Range("G11:G298")
i = 1
bLunchDue = False
bHadLunch = False
' now walk across the row or reference cells in the row.
For Each cell1 In cell.Resize(1, 96 - 7)
If Application.CountIf(cell1.Resize(1, 8), "IND") = 8 Then
If bLunchDue Then
cell1.Offset(0, 8).Value = "lun"
bLunchDue = False
bHadLunch = True
Else
cell1.Offset(0, 8).Value = "brk"
If Not bHadLunch Then bLunchDue = True
End If
End If
Next
Nex