Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering again Diski Excel Discussion (Misc queries) 1 September 30th 09 02:18 AM
Filtering Paul X Excel Discussion (Misc queries) 1 May 14th 09 11:21 AM
visible rowindex Chris Excel Worksheet Functions 3 September 2nd 08 02:40 PM
Filtering? Dendy Excel Discussion (Misc queries) 5 August 25th 08 07:12 PM
trouble filtering a list. Why isn't column filtering? Pat Excel Worksheet Functions 1 July 18th 05 03:30 PM


All times are GMT +1. The time now is 01:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"