Consulting

Results 1 to 2 of 2

Thread: xllastrow range - problem

  1. #1

    xllastrow range - problem

    Hi does anybody know how to set the xllastrow RANGE for example A20:A30? Because my listbox schows always 10 blank rows - because from A31 my rows are filled in, so i need to range it otherwise... thanks for your advice

    With Worksheets(WorksheetName)
    xlLastrow = .Cells.Find("*", .Cells(1), xlFormulas, _
    xlWhole, xlByRows, xlPrevious).Row

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    this will give you the last used row in column A[VBA]xllastrow=.Range("A" & rows.count).end(xlup).row[/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •