+ Reply to Thread
Results 1 to 6 of 6

refer to cell in another workbook with variable sheet name

  1. #1
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    204

    refer to cell in another workbook with variable sheet name

    Can anyone provide VBA for the following:

    I have two workbooks (Book1 and Book2). The code operates from Book 1.

    In Book1, Sheet1, Cell A1 is some text (A 3 letter code) which changes according to other cirteria.

    Book 2 contains several sheets which are named with the text I just mentioned followed by another word ('Result'). Cell B3 in each contains a number that I want to refer to.I need VBA code that will refer to the relevant sheet using the text in A1 but I can't seem to get anything working.

    I've tried the following which I suppose shows my complete lack of understanding of VBA...:
    Please Login or Register  to view this content.
    Last edited by wonderdunder; 07-15-2011 at 04:23 AM.

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: refer to cell in another workbook with variable sheet name

    Hi wonderdunder, the following code has not been tested at run-time but give it a try.
    Please Login or Register  to view this content.
    Also, I don't know what you were trying to achieve with "Cert No" from your post. At any rate, good luck!

    Regards
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: refer to cell in another workbook with variable sheet name

    Hi wonderdunder, my last post does not work. However, try
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    204

    Re: refer to cell in another workbook with variable sheet name

    Many thanks - Haven' tried it yet but I suspected all these Dim things would crop up! Just seems an awful lot of code for such a simple task. But hey.....

    I'll let you know how it goes.

  5. #5
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: refer to cell in another workbook with variable sheet name

    It's really not that much code!

  6. #6
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    204

    Re: refer to cell in another workbook with variable sheet name

    That's solved now - I had an error in my code (extra space of all things!).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1