Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Is it possible in VBA to find the last cell with data in a closed workbook?

    I have tried to use the find function:

    .Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious)

    But it requires that the workbook is open. Am I doing it wrong, or is there an other way?

    BR
    Jones

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think this requires the file to be open indeed.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    [quote name='Jonesy' post='775372' date='16-May-2009 01:06']But it requires that the workbook is open. Am I doing it wrong, or is there an other way?[/quote]
    The workbook must be opened to perform the task but if you can describe why the workbook can't be opened then it may be possible to workaround the issue. You could open the workbook without displaying it on screen or you could also make a copy of the workbook and open the copy instead.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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