+ Reply to Thread
Results 1 to 6 of 6

Referencing with Indirect

  1. #1
    Registered User
    Join Date
    09-13-2008
    Location
    Barrie, ON, CA
    Posts
    47

    Referencing with Indirect

    The Question I have is with the "indirect" function... I was wondering if there is anyway to include Sheets and maybe workbooks into the function:

    i.e.
    'Sheet1'!C3="Apples"

    (lets pretend the following cells are on sheet2)
    Cell A1= 'Sheet1'!
    Cell A2= C
    Cell A3= 3
    Cell A4=A1&A2&A3

    =in theory, indirect(A4) would have an expected reference to
    'Sheet1'C3 (= "Apples") but instead i get invalid Reference error.
    I was wondering if there is any solution to this as it is a very inportant piece in my work and this ability would be a great asset.

    Thanks for the time

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try
    Sheet1!
    in A1 instead

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    09-13-2008
    Location
    Barrie, ON, CA
    Posts
    47

    Did not work

    i tried like you said to drop the ' ' around the sheet name still get the same error... did you try it ? is there another posible way?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Yes. It worked for me see example

    This also worked

    'Sheet1!
    VBA Noob
    Attached Files Attached Files

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    You only need the single quote in the sheet name contains spaces -- but then you need two, because Excel interprets the first as a text delimiter. To accommodate either case, use the quote.

    So enter

    ''Sheet1'!

    ... which appears as

    'Sheet1'!

    ... and you're golden.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    09-13-2008
    Location
    Barrie, ON, CA
    Posts
    47

    Good to go

    oh I C... My problem was that my sheet name had a space in it so the '' ' around the sheet name was required... my bad for not giving you the specifics... thanks for all your help guys really appreciate it.

    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Indirect for Workbook Name
    By nms2130 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-21-2008, 04:43 PM
  2. Indirect Variable
    By mycon73 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-21-2008, 12:01 AM
  3. Alternative to INDIRECT with Dependent Lists
    By RDSProgrammer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2007, 03:10 PM
  4. INDIRECT and dynamic ranges
    By inky in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2007, 04:08 PM
  5. INDIRECT cell referencing question.
    By call_me_bob in forum Excel General
    Replies: 7
    Last Post: 04-03-2007, 09:21 PM

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