+ Reply to Thread
Results 1 to 3 of 3

INDIRECT() - Theres got to be a better way to do this....

  1. #1
    Registered User
    Join Date
    01-20-2023
    Location
    Dubai
    MS-Off Ver
    Microsoft 365
    Posts
    1

    Lightbulb INDIRECT() - Theres got to be a better way to do this....

    Hello,

    I would be very grateful if anyone has any good ideas to make this code more general.

    I am currently using this long formula to pull an ARRAY of data from various workbooks. The code works.... but there must be a more general way to do it. Especially if i want to add more books, then it becomes longwinded to type them out

    =INDIRECT(Finance!$A$4&".xlsx!"&AT9)
    +INDIRECT(Finance!$A$5&".xlsx!"&AT9)
    +INDIRECT(Finance!$A$6&".xlsx!"&AT9)
    +INDIRECT(Finance!$A$7&".xlsx!"&AT9)
    +INDIRECT(Finance!$A$8&".xlsx!"&AT9)
    +INDIRECT(Finance!$A$9&".xlsx!"&AT9)
    +INDIRECT(Finance!$A$10&".xlsx!"&AT9)
    +INDIRECT(Finance!$A$11&".xlsx!"&AT9)
    +INDIRECT(Finance!$A$12&".xlsx!"&AT9)
    +INDIRECT(Finance!$A$13&".xlsx!"&AT9)

    If you resolve the first line it looks like this =Indirect("C0463.xlsx!$D$16:$CY$16")

    So the question is... how can i reduce this code into a single line by using the range A4:A13 instead of A4+A5+A6+A7+A8+A9...+A13
    Id like it as a single line in the formula bar, so no VBA please.

    Also, this is my first post. I'm looking forward to contributing in this great community!

  2. #2
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: INDIRECT() - Theres got to be a better way to do this....

    Hi,
    I can only guess how long you haven't attached any sample file. If the name of worksheets are in the same order like in the workbook :

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

    Change Sheet4, sheet13 with actual names for first and last sheet in your series
    Diana Tanase


    If the solutions offered helped you to solve your problem, then mark the thread as SOLVED (thread tools in the top menu) and you can click on * to add reputation to those who helped you, as a way to say thank you !

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,996

    Re: INDIRECT() - Theres got to be a better way to do this....

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 non-editable pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet complete with an explanation and some expected results.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

+ 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. [SOLVED] INDIRECT Function with multiple sheets - SUMIF, INDIRECT & MATCH
    By DJDRU in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-07-2014, 08:42 AM
  2. Sum of indirect sheet names with multiple cells (SUM, INDIRECT,SHEETNAME in cell)
    By a1b2c3d4e5f6g7h8 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-12-2013, 08:42 AM
  3. Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Andy Wiggins in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 06:05 AM
  4. [SOLVED] Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. [SOLVED] Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Tags for this Thread

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