Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Find first row number after filtering

I set up an autofilter and select the rows that have a blank value in the
column. that's fine. I want to go to the first selected row. When I record
a macro to go to the heading row and then arrow down once, the macro records
the actual row I end up in (A37 in this case). But I need to set a variable
as the next time I run (on a different file) it won't necessarily be A37.
How do I find the row number of the first row after the header row in an
autofiltered spreadsheet?

Appreciate any light you can shed. thanks in advance,
StevenM
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Find first row number after filtering

Post the code ir formula you are using so we have a starting point/


"StevenM" wrote in message
...
I set up an autofilter and select the rows that have a blank value in the
column. that's fine. I want to go to the first selected row. When I
record
a macro to go to the heading row and then arrow down once, the macro
records
the actual row I end up in (A37 in this case). But I need to set a
variable
as the next time I run (on a different file) it won't necessarily be A37.
How do I find the row number of the first row after the header row in an
autofiltered spreadsheet?

Appreciate any light you can shed. thanks in advance,
StevenM



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Find first row number after filtering

Hi Steven,

Try this :

'---------------------------------
Sub First_Row()
On Error Resume Next
With ActiveSheet
If .AutoFilterMode = True Then
With .Range("_FilterDatabase")
MsgBox .Offset(1).Resize(.Rows.Count - 1, _
Columns.Count).SpecialCells(xlCellTypeVisible).Row
End With
End If
End With
End Sub
'---------------------------------


"StevenM" a écrit dans le message de groupe de
discussion : ...
I set up an autofilter and select the rows that have a blank value in the
column. that's fine. I want to go to the first selected row. When I record
a macro to go to the heading row and then arrow down once, the macro records
the actual row I end up in (A37 in this case). But I need to set a variable
as the next time I run (on a different file) it won't necessarily be A37.
How do I find the row number of the first row after the header row in an
autofiltered spreadsheet?

Appreciate any light you can shed. thanks in advance,
StevenM

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Find first row number after filtering

thanks, I see that it returns the row number. Now I would just like to
figure out a) how the heck does it work, and b) saving it to a variable.

"MichDenis" wrote:

Hi Steven,

Try this :

'---------------------------------
Sub First_Row()
On Error Resume Next
With ActiveSheet
If .AutoFilterMode = True Then
With .Range("_FilterDatabase")
MsgBox .Offset(1).Resize(.Rows.Count - 1, _
Columns.Count).SpecialCells(xlCellTypeVisible).Row
End With
End If
End With
End Sub
'---------------------------------


"StevenM" a écrit dans le message de groupe de
discussion : ...
I set up an autofilter and select the rows that have a blank value in the
column. that's fine. I want to go to the first selected row. When I record
a macro to go to the heading row and then arrow down once, the macro records
the actual row I end up in (A37 in this case). But I need to set a variable
as the next time I run (on a different file) it won't necessarily be A37.
How do I find the row number of the first row after the header row in an
autofiltered spreadsheet?

Appreciate any light you can shed. thanks in advance,
StevenM


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
Find previous number and find next number in column DoubleZ Excel Discussion (Misc queries) 4 March 4th 09 08:51 PM
Filtering and Text/number problems Jugglertwo Excel Discussion (Misc queries) 3 September 26th 08 06:24 PM
count the number of cell entries after filtering Gazza Excel Discussion (Misc queries) 2 March 16th 06 01:31 PM
Excel auto filtering to find a range of dates in a list Candy Excel Discussion (Misc queries) 2 January 31st 06 02:32 PM
Advanced filtering in Excel to find records ending in xxx? dtencza Excel Discussion (Misc queries) 2 August 14th 05 03:16 PM


All times are GMT +1. The time now is 12:06 PM.

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

About Us

"It's about Microsoft Excel"