I have a range of cells in one row. I want to test if they all do not have content.
I found If Not IsError(Application.Match(ValueToSearchFor, RangeToSearchIn, 0)) Then
I fixed the ranges to be more like my needs:
If Not IsError(Application.Match("", rRng.Offset(lOffset).Range(Cells(1, 1), Cells(1, rRng.Columns.Count)), 0)) Then
It didn't jump into my conditional statement.
I tried the opposite:
If Not IsError(Application.Match("<>", rRng.Offset(lOffset).Range(Cells(1, 1), Cells(1, rRng.Columns.Count)), 0)) Then
It didn't hit my conditional statement.
I checked that a range existed:
rRng.Offset(lCorrection).Range(Cells(1, 1), Cells(1, rRng.Columns.Count)).Select
The correct range is selected.
I believe the condition "" or "<>" are correct input, its simpler than put in a cell reference.
What about the looping, is there something I missed?
rRng.Offset(lOffset).Rangeis looking at whatever sheet and range thatrRngis set to, but within that range you're using justCells(1,1)which is pointing to cell A1 on whatever sheet is currently active. It should be something likerRng.Cells(1,1), or mayberRng.Offset(lOffset).Range(rRng.Offset(lOffset).Cells(1,1),....