![]() |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 01:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com