How to copy visible cells after filter in VB

Closed
Lavanya - Jun 11, 2010 at 07:00 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jun 13, 2010 at 10:33 AM
Hello Team ,

How to write a code in VB which will filter the visible cells after a autofilter has been applied .As my data range chnages with each report .Please help me



Related:

19 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 11, 2010 at 07:18 AM
Before you apply the filter, find out the max number of rows

Then apply the filter

Now copy for row to last row (as evaluated before)

Rows("2:" & lMaxRow).copy

row I am using as example, you can have a range

When you paste it will only paste visible rows
1