Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I find the first row in a table?

Best of Excel

How can I find the first row in a table?

by  SkipVought  Posted    (Edited  )
Assuming that you do not ALWAYS start your tables in Row 1 (for instance if you want totals displayed above your table)
1. table must start in Column "A"
2. there must be a blank row ABOVE the first row of your table
3. your table must have contiguous data, ie no blank rows or columns within your table.
Here is a function that returns the first row in your table
Code:
Function HeaderRow() As Long
    HeaderRow = Cells(Cells.Rows.Count, 1).End(xlUp).CurrentRegion.Row
End Function
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top