Hello,
I have a longer code, but I'll save space. Essentially I have a "For Each rCell in Range..." code and I want to use that moving rCell as a reference to create another variable (sCell) that is used just for that one rCell, then on to the next rCell.
For Each rCell In Range(Range1a, Range1b)
If rCell Is Nothing Then
Else
With Workbooks("FY12-Q3 Data Tables.xlsx").Sheets("TOTAL RESPONDENTS").Columns(1)
Set sCell = rCell.Offset(0, 1).Value
Set c = .Find("[" & rCell & "B" & "]", LookIn:=xlValues)
Set c = .Find(sCell, After:=c)
Set c = .Find("Bottom 2 (NET)", After:=c)
If I have to I can move rCell to the other variable and double the code to eliminate the use of two cell variables (rCell and sCell), but I would need help with this part:
How would I then write a For Each/If statement that skips Blanks AND specific text. For example, I would want the range to be really long and skip all blanks cells and cells with "Name Brand" text and cells with "Private Brand" text. I tried to play with that on a different sheet, but couldn't get it quite right. I have also skipped that sheet and possibly fixed what was causing it not to work above...
All help is very much appreciated.
I have a longer code, but I'll save space. Essentially I have a "For Each rCell in Range..." code and I want to use that moving rCell as a reference to create another variable (sCell) that is used just for that one rCell, then on to the next rCell.
For Each rCell In Range(Range1a, Range1b)
If rCell Is Nothing Then
Else
With Workbooks("FY12-Q3 Data Tables.xlsx").Sheets("TOTAL RESPONDENTS").Columns(1)
Set sCell = rCell.Offset(0, 1).Value
Set c = .Find("[" & rCell & "B" & "]", LookIn:=xlValues)
Set c = .Find(sCell, After:=c)
Set c = .Find("Bottom 2 (NET)", After:=c)
If I have to I can move rCell to the other variable and double the code to eliminate the use of two cell variables (rCell and sCell), but I would need help with this part:
How would I then write a For Each/If statement that skips Blanks AND specific text. For example, I would want the range to be really long and skip all blanks cells and cells with "Name Brand" text and cells with "Private Brand" text. I tried to play with that on a different sheet, but couldn't get it quite right. I have also skipped that sheet and possibly fixed what was causing it not to work above...
All help is very much appreciated.