mdavontuur25
New Member
- Joined
- May 5, 2011
- Messages
- 11
Hi Excel Gurus
I have been struggling to write this code for weeks.
I want to use advance filter in a macro to extract data in a worksheet that starts with cell B8 (headings is in this row) and it must find the last row of data. eg range = B8:last data row
Currently I have this code
Sub Filter()
Sheets("cbpay").Range("B8:M26").End(xlUp).AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("A1:G1"), Unique:=False
End Sub
As you can see the range is currently just from B8:M26, however sometimes I have 2000 rows and at other times only 4 or 5.
Please help!!!
mOMAn
I have been struggling to write this code for weeks.
I want to use advance filter in a macro to extract data in a worksheet that starts with cell B8 (headings is in this row) and it must find the last row of data. eg range = B8:last data row
Currently I have this code
Sub Filter()
Sheets("cbpay").Range("B8:M26").End(xlUp).AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("A1:G1"), Unique:=False
End Sub
As you can see the range is currently just from B8:M26, however sometimes I have 2000 rows and at other times only 4 or 5.
Please help!!!
mOMAn