Scanning through an autofilter

residnt

Board Regular
Joined
Nov 19, 2002
Messages
168
Hello All I have another question for you. What I have is a macro that continually goes through a list comparing what is found to another list. Now what we are trying to do is use an autofilter to ease some of the problems so it will only look through the items that are filtered out and not the hidden rows. Is there any way to do this.

Thanks
Residnt
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Where the list has been filtered, the specialcells method will enable you to find only the visible cells

eg

Activeworkbook.worksheets(1).Range("_Filterdatabase").SpecialCells(xlCellTypeVisible).select will select the visible range in the autofilter on sheet one in teh active workbook.

In a macro you could assign a range object to this result and loop through the range.
eg

Dim rngVisible as range
Dim C as range
set rngVisible = Activeworkbook.worksheets(1).Range("_Filterdatabase").SpecialCells(xlCellTypeVisible)
for each c in RngVisible
do something
Next
 
Upvote 0

Forum statistics

Threads
1,213,486
Messages
6,113,932
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top