I have filtered data that i want to be able to loop thru without actually selecting the next cell in the range. I am just grabbing the values and pasting them on a different spreadsheet. The problem i have is selecting the next cells that are not in sequential order. Here is my code but it does not work. If my visible range jumps from 5 to 20, my strSubGroupNext will always take row 6 instead of row 20. Any suggestions? I have tried offset to no avail and many other possibilities.
Range("D2:D" & LastRow_Master).Select
Selection.SpecialCells(xlCellTypeVisible).Select
f = 1
For Each strSubGroup In Selection.SpecialCells(xlCellTypeVisible)
strSubGroupNext = Selection.SpecialCells(xlCellTypeVisible)(f + 1).Value
strGroup = Selection.SpecialCells(xlCellTypeVisible).Offset(0, -1)(f).Value
strGroupnext = Selection.SpecialCells(xlCellTypeVisible).Offset(1, -1)(f).Value
More code here......
Next
Range("D2:D" & LastRow_Master).Select
Selection.SpecialCells(xlCellTypeVisible).Select
f = 1
For Each strSubGroup In Selection.SpecialCells(xlCellTypeVisible)
strSubGroupNext = Selection.SpecialCells(xlCellTypeVisible)(f + 1).Value
strGroup = Selection.SpecialCells(xlCellTypeVisible).Offset(0, -1)(f).Value
strGroupnext = Selection.SpecialCells(xlCellTypeVisible).Offset(1, -1)(f).Value
More code here......
Next