+ Reply to Thread
Results 1 to 6 of 6

Offset & Indirect

  1. #1
    Registered User
    Join Date
    01-08-2007
    Posts
    7

    Exclamation Offset & Indirect

    I was reading a thread concerning the OFFSET & INDIRECT functions. I need it to reference a another workbook. I wrote in the formula like the one on the thread and instead of refering to the worksheet in the current workbook, I referenced the other worksheet and workbook. I am getting a REF# back what am I doing wrong or am I able to reference a different workbook. An example of the formula is below. I need to find a way to reference the other workbook and worksheet.

    =IF(OFFSET(INDIRECT("Sheet1!A1"),ROW()-1,COLUMN()-1)=0,"",OFFSET(INDIRECT("Sheet1!A1"),ROW()-1,COLUMN()-1))

  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
    Hi,

    I can't see the other workbook name

    e.g

    =[Book1]Sheet1!$A$1

    Also indirect can only be used if the other workbook is open.

    http://www.ozgrid.com/News/IndirectE...hooseArray.htm

    unless you use the addin from this site

    http://xcell05.free.fr/english/moref...direct.ext.htm

    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
    01-08-2007
    Posts
    7
    Here is what I type for the formula

    =IF(OFFSET(INDIRECT('[JPAE - JobPower to Excel.xls]JPAE-JobPower to Excel'!A200),ROW()-1,COLUMN()-1)=0,"",OFFSET(INDIRECT('[JPAE - JobPower to Excel.xls]JPAE-JobPower to Excel'!A200),ROW()-1,COLUMN()-1))

  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
    So the book name is same as the sheet name ??

    Instead of typing try selecting the other workbook

    VBA Noob

  5. #5
    Registered User
    Join Date
    01-08-2007
    Posts
    7
    That's what I did. In where the ("Sheet1!A1") was. I highlighted and then switched over to the other book and selected the cell I wanted to refer to. Does it have to always reference "A1" cell. I noticed in a spreadsheet that I downloaded that every cell referenced that particular cell. If you notice my references "A200".

  6. #6
    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
    Think you are trying to run before you can walk. Take a look at excel help re offset's to understand what cell you think you need to reference


    VBA Noob

+ 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