Consulting

Results 1 to 4 of 4

Thread: Workbook Reference

  1. #1

    Workbook Reference

    Hi all,

    First post here, hoping someone can give me a hand. Ive just finished creating a macro that will create a new workbook and copy relative data over and make it look pretty. I then find out my boss will be renaming the first workbook on a regular basis!!. My code relies on referencing to the original workbook when it comes to copying.

    Is there anyway of creating a variable that will refer to the first workbook? Or some way or referencing to the first workbook without actually using its name?

    Thanks

  2. #2
    ooo actually if I just refer to it as Workbooks(1), will the index take into account another Excel documents opened before the one in question? Or will the macro always refer to the Workbook its in to be number 1 on the index?

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You can never relyt on the workbook that you want being workbook 1,2, 3 or anything else.

    Somewhere you must open it, how do you know what it is called at that point?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    Thats for the reply xld but I have solved the problem now

Posting Permissions

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