Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofiltered cell value (VBA)
I would like to get cell's value [like using i.e cells(x,y).value]
from the rows which are visible after autofiltering. How to get only these visible values? For example: If I have 10 rows but only 2 rows matching the autofilter criteria. For i=1 to 10 Msgbox Range.Cells(i, 1).value Next i This code gives me all the values - it don't considering to autofiler results... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofiltered cell value (VBA)
Hi Jaro,
One way: Sub Tester02() Dim cell As Range Dim Rng As Range Dim x As Long Const y As Long = 1 Set Rng = ActiveSheet.AutoFilter.Range Set Rng = Rng.Offset(1).Resize(Rng.Rows.Count - 1) Set Rng = Rng.Columns(y).SpecialCells(xlCellTypeVisible) For Each cell In Rng x = x + 1 If x 10 Then Exit For MsgBox cell.Value Next cell End Sub --- Regards, Norman "Jaro" wrote in message om... I would like to get cell's value [like using i.e cells(x,y).value] from the rows which are visible after autofiltering. How to get only these visible values? For example: If I have 10 rows but only 2 rows matching the autofilter criteria. For i=1 to 10 Msgbox Range.Cells(i, 1).value Next i This code gives me all the values - it don't considering to autofiler results... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I add up cells that are autofiltered? | Excel Worksheet Functions | |||
autofiltered file | Excel Discussion (Misc queries) | |||
Selecting autofiltered cells | Excel Programming | |||
Filling An Autofiltered List | Excel Programming | |||
Filling An Autofiltered List | Excel Programming |