Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Excel: Find the first empty row on the spreadsheet (Read 3631 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Excel: Find the first empty row on the spreadsheet
24.07.09 at 15:23:56
 
Excel: Find the first empty row on the spreadsheet
 
Quote:
How to find the first empty row on a spreadsheet

 
In a new module paste the following macro code and run it:
 
Code:
Public Sub test()
  Dim wks As Worksheet
  
  Set wks = ActiveSheet
  
  With wks.UsedRange
    Debug.Print "Used Range=" & .Address
    Debug.Print "First row=" & .Rows(1).Row
    Debug.Print "Last row=" & .Rows(.Rows.Count).Row
    Debug.Print "First empty row=" & .Rows(.Rows.Count).Row + 1
  End With
End Sub
 


 
Output:
Used Range=$B$9:$F$19
First row=9
Last row=19
First empty row=20
Back to top
 
 

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1