+ Reply to Thread
Results 1 to 11 of 11

Varibles inside formulas!

  1. #1
    Registered User
    Join Date
    07-18-2007
    Posts
    6

    Unhappy Varibles inside formulas!

    Greetings,
    THis is the oringinal formula:
    =c:\Path\[test.xls]Test Resultst'!$H$19
    So basically it's taking the information from the cell in test.xls, in sheet test results, H 19. This works perfectly. Now, I want the end number, 19, to be the value of a cell on the original worksheet, etc:
    =c:\Path\[test.xls]Test Resultst'!$H$(W14)
    So on the oringinal worksheet (that we want to copy this information from), the value in cell W14, let's say it's 19.
    So it will go to H19 in that cell.

    Basically I want to use a cell value inside the formula, but I cant get it to work!
    Help would be greatly appriciated, I'm a newb, so please respect me a little bit

    Cheers.

  2. #2
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi

    You need to use INDIRECT

    =indirect("c:\Path\[test.xls]Test Resultst'!$H$"&W14)

    Ed

  3. #3
    Registered User
    Join Date
    07-18-2007
    Posts
    6
    Thanks a lot for your reply ED,
    I did as you told me, and pasted this formula:
    =INDIRECT("E:\files\[test_e_1801.xls]Test Resultst'!$H$"&W14)

    THe file is correct, since:
    E:\\files\test_e_1801.xls
    exists
    The sheet name there is
    Test Resultst
    And in W14 there is 19 in the original file.
    Stile im getting the;
    #REF!
    error?

    Any ideas? Thank you so much!

    Edit: W14 is underlined as a error by the way... :/

    Updated:
    I realised that this wouldn't help me to much, so I figured out this formula:
    ROW()+5
    So maybe if I put in that formula inside W14, would that work? Or could I somehow include getformula function somehow. Anyhow insted of getting 19 I like to get that formula, if possible
    I know I'm asking for much, but I tried googlin for hours and trying solutions, and I just cant figure it out...

    Thank you
    Last edited by jonaslol; 07-18-2007 at 09:49 AM.

  4. #4
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi,

    The source file has to be open to use indirect - if it's not it will give an error.

    let me know how you go

    Ed

  5. #5
    Registered User
    Join Date
    07-18-2007
    Posts
    6
    Ok, I understand but I still get a error. The thing is that I have the original workbook open, I have the workbook to get information from open, and I have the source (alt f11) openm, dispite I have nothing in there...
    err :/

  6. #6
    Registered User
    Join Date
    07-18-2007
    Posts
    6
    Ok, I understand but I still get a error. The thing is that I have the original workbook open, I have the workbook to get information from open, and I have the source (alt f11) openm, dispite I have nothing in there...
    err :/

    Sorry for double post, came up error so I tried twice, sorry.
    Last edited by jonaslol; 07-19-2007 at 02:36 AM.

  7. #7
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi

    Have you tried using the formula evaluation tools to see where the problem arises (Tools >formula auditing >evaluate formula).

    have you got a typo somewhere, is a name slightly different - if all is right, it should work.

    Ed

  8. #8
    Registered User
    Join Date
    07-18-2007
    Posts
    6
    Ok I'm soon giving up, :P
    This is how the cell looks right now:
    =INDIRECT("E:\file\file info\file Test Data\folder that it is in\[testdata.xls]test'!$H$"&W14)
    Some folders contains spaces.

    testdata is the name of the file.
    test is the sheet name
    Directory is correct.
    All above been double checked many times now.

    Both files are in the same folder!
    The original folder that the data is supposed to come in is named:
    test
    So I got test opened, test data opened. I hit enter in the formula and the error occur.

    I tried the formula evaluation thing.
    First up W14 is underlined.
    Then it is replaced by 19 and everything is underlined.
    Then it changes a bit, and becomes like this:
    =INDIRECT("E:\file\file info\file Test Data\folder that it is in\[testdata.xls]test'!$H$19")
    It is Italic and underlined.
    Then I get the #REF! error

    Thank you for your time

  9. #9
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    OK,

    It looks like the formula is working - So what is in

    E:\file\file info\file Test Data\folder that it is in\[testdata.xls]test'!$H$19

    Ed

  10. #10
    Registered User
    Join Date
    07-18-2007
    Posts
    6
    In H19 there is just a simple number, 1040.
    It is formated as "custom"
    And the 6 first rows are locked, so u can always see them.
    thank you

  11. #11
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    I think the answer lies in getting rid of the spaces in the file path and the single ' marks.

    That's my last shot

    Ed

+ 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