Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Know rowindex after filtering
Hi,
Via VBA i filtered a sheet. Basically i should have as result only 1 row. How can i know what is the rowindex (figure in the grey column margin e.g : 873, or 34245,...) ? thanks a lot, Maileen |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Know rowindex after filtering
You have a reply to your post in .excel.
Maileen wrote: Hi, Via VBA i filtered a sheet. Basically i should have as result only 1 row. How can i know what is the rowindex (figure in the grey column margin e.g : 873, or 34245,...) ? thanks a lot, Maileen -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Know rowindex after filtering
Assuming an autofilter
Dim rng as Range, rng1 as Range set rng = Activesheet.autoFilter.Range set rng = rng.offset(1,0).Resize(rng.rows.count-1,1) On error resume next set rng1 = rng.SpecialCells(xlvisible) On Error goto 0 if not rng1 is nothing then msgbox rng1(1).row if rng1.count 1 then msgbox "Multiple matches" else msgbox "No matches" End if Dim rng as Range, res as Variant set rng = Activesheet.autoFilter.Range set rng = rng.offset(1,0).Resize(rng.rows.count-1,1) res = Application.Match(filtervalue,rng,0) if not iserror(res) then msgbox rng(res).Row else msgbox "No Matches" End if -- Regards, Tom Ogilvy "Maileen" wrote in message ... Hi, Via VBA i filtered a sheet. Basically i should have as result only 1 row. How can i know what is the rowindex (figure in the grey column margin e.g : 873, or 34245,...) ? thanks a lot, Maileen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filtering again | Excel Discussion (Misc queries) | |||
Filtering | Excel Discussion (Misc queries) | |||
visible rowindex | Excel Worksheet Functions | |||
Filtering? | Excel Discussion (Misc queries) | |||
trouble filtering a list. Why isn't column filtering? | Excel Worksheet Functions |