Trebor8484
Board Regular
- Joined
- Oct 27, 2018
- Messages
- 69
- Office Version
- 2013
- Platform
- Windows
Hi,
The code below is supposed to iterate through a range, so x starting from row 16 through to 25 and y to control the column increment from 5 to 13, i.e. E to M.
The line highlighted in red is incorrect, can someone advise how this should be written or a different approach please?
For reference, it is always columns E:M and rows 16 to 25.
Thanks
The code below is supposed to iterate through a range, so x starting from row 16 through to 25 and y to control the column increment from 5 to 13, i.e. E to M.
The line highlighted in red is incorrect, can someone advise how this should be written or a different approach please?
For reference, it is always columns E:M and rows 16 to 25.
Code:
For y = 5 To 13
x = 16
FailCount = 0
[COLOR=#ff0000] For Each c In sht.Range(Cells(x), Cells(0, y))[/COLOR]
If c.Value = "N" Then
FailCount = FailCount + 1
End If
Next c
If FailCount > 0 Then
'rest of my code here
End If
x = x + 1
Next y
Thanks