+ Reply to Thread
Results 1 to 11 of 11

Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Luxembourg
    MS-Off Ver
    MS365 version 2202
    Posts
    11

    Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    Hello again,

    As you helped me yesterday very quickly, I try my luck again.

    I have different sheets from "01" to "13" that contain monthly billings in a workbook called "Salaire Welter.xlsx" (in fact I have 4 of those workbooks, just differently called). I'd now like to copy these values into a new workbook with only the sheet reference changing by dragging the formula horizontally to the left.

    This is the cell I'd like to refer:

    ='[Salaire Welter.xlsx]01'!$J$40

    It's the "01" that should change to "02" then to "03" and so on.

    I'd be very grateful for your precious help.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,873

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    You can use this formula in the first cell:

    =INDIRECT("'[Salaire Welter.xlsx]"&TEXT(COLUMNS($A:A),"00")&"'!$J$40")

    and then copy it across. You should note, though, that INDIRECT does not work with closed workbooks, so you must ensure that the file Saltaire Welter.xlsx is open in the same instance of Excel as the file that contains the formula.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    08-22-2012
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    Hi Marc Poos,
    you can try with this code
    Please Login or Register  to view this content.
    Please note that you have to change value of COLUMN() if your formula has not placed in column A.
    For example COLUMN() in column A evaluate as 1, in column B evaluate as 2 etc. If you possibly place this formula in column F and you need evaluation 1 you have to change "COLUMN()" with "COLUMN()-5"

    Regards,
    If a post helps press star sign 4 my reputation

  4. #4
    Registered User
    Join Date
    01-22-2013
    Location
    Luxembourg
    MS-Off Ver
    MS365 version 2202
    Posts
    11

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    Hello Pete,

    Thank you, but unfortunately, when copy/pasting your formula in my cell, Excel says "the formula you typed contains an error".

    Marc

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    Luxembourg
    MS-Off Ver
    MS365 version 2202
    Posts
    11

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    Hello mnjofra,

    Thank you, but unfortunately, I get, as it does for Pete's code, the message that "the formula (...) contains an error" when copy/pasting it.

    Marc

  6. #6
    Registered User
    Join Date
    08-22-2012
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    Hi Marc Poos,
    I dont know what international settings of Windows you have. Possibly you have to change comma <,> with semicollon <;> in formula if you have decimal comma instead of decimal point in your domestic standard.. In Croatia we have the same problem.

    Regards,

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,873

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    Quote Originally Posted by Marc Poos View Post
    Hello Pete,

    Thank you, but unfortunately, when copy/pasting your formula in my cell, Excel says "the formula you typed contains an error".

    Marc
    Try it like this instead:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Hope this helps.

    Pete

  8. #8
    Registered User
    Join Date
    01-22-2013
    Location
    Luxembourg
    MS-Off Ver
    MS365 version 2202
    Posts
    11

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging


    It worked!!!!

    Thank to both of you!!

  9. #9
    Registered User
    Join Date
    08-22-2012
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    I'm glad, seems you're very happy

  10. #10
    Registered User
    Join Date
    04-12-2013
    Location
    jakarta,indonesia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    Hi Pete Uk, mnjofra and Marc Poos

    I have the same problem too, but the formula cannot work.

    ='[shoes.xlsx]art1'!$v$11

    It's the "art1" that should change to "art2" and so on.

    I'd be very grateful for your precious help.
    Thanks...

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,873

    Re: Change sheet reference OF ANOTHER WORKBOOK automatically by dragging

    @batakman

    If you take the time to read the Forum Rules at the top of the screen you will see that you should not post a question in someone else's thread - instead, you should start your own thread.

    Pete

+ 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