I am able to apply an autofilter to a worksheet, then copy the visible rows to another Workbook (New) just fine. I need to, when I return to the filtered worksheet, add data to a cell outside of the .AutoFilter.Range for only the visible rows. (Col M).
I could loop through the entire worksheet and match on the AutoFilter criteria but that will take longer if/as the sheet grows in size.
I am hoping to find a more direct way.
What I have so far is:
Which is giving me the error:
438 - Object doesn't support this property or method.
Whenever I try to check the visible or hidden property I get an error.
I have tried setting the range object with:
with similar results.
Is it possible to do in one operation or am I stuck with looping the entire sheet?
Thanks in Advance to anyone offering ideas.
Joel
I could loop through the entire worksheet and match on the AutoFilter criteria but that will take longer if/as the sheet grows in size.
I am hoping to find a more direct way.
What I have so far is:
Code:
Set rngInvSum = .AutoFilter.Range
rngInvSum.Select
For lngRow = rngInvSum.row To rngInvSum.Rows.count
If Not .currentrow.Hidden Then
Range("M" & lngRow) = Right(strNewSheet, Len(strNewSheet) - 10)
End If
Next
438 - Object doesn't support this property or method.
Whenever I try to check the visible or hidden property I get an error.
I have tried setting the range object with:
Code:
Set rngInvSum = Range("A2").End(xlDown).xlSpecialCells(xlCellTypeVisible)
Set rngInvSum = Range(Range("A1"), Range("A1").End(xlDown)).SpecialCells(xlCellTypeVisible)
Is it possible to do in one operation or am I stuck with looping the entire sheet?
Thanks in Advance to anyone offering ideas.
Joel