+ Reply to Thread
Results 1 to 10 of 10

Getting the value from sub sheets

  1. #1
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Getting the value from sub sheets

    Hi,

    We have a excel file in there we have many sub sheets, but for demo we have created only two

    in sheet1, we have the following data
    S.No. Name Number
    1 2
    1 test1 300 318

    2 test2 445 408

    we have two sub sheets which names are test1 and test2. We are taking the number 1 and Number 2 value from sub sheets (as per attached sheet)

    We are using the function =temp1!B2 for getting the data but we have approx 20 sub sheets and want to get the data from there but when we add some new sheets, again we need to do it manually

    any option " =temp1!B2 " instead of this
    Attached Files Attached Files

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

    Re: Getting the value from sub sheets

    You can use the INDIRECT function to get the data from different sheets. Will your sheet names follow some pre-defined format (like Temp1 and Temp2 in your example file), or can the Name column (B) in Sheet1 contain the names of the sheets?

    Pete

  3. #3
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Getting the value from sub sheets

    Thanks for the update Pete_UK

    we have the sheet names,
    Goldy, Raghav, Gupta, MDH

    any example with INDIRECT function

    pls

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

    Re: Getting the value from sub sheets

    So, as well as those names being applied to each sheet tab, will they also appear in the Name column of Sheet1?

    Pete

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

    Re: Getting the value from sub sheets

    Assuming that the names are in column B, you can use this formula in C3:

    =INDIRECT("'"&$B3&"'!B"&C$2+1)

    and copy into D3. Then copy C3:D3 down for your other names.

    Hope this helps.

    Pete

  6. #6
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Getting the value from sub sheets

    not working bro

    showing error #REF!

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

    Re: Getting the value from sub sheets

    You have probably mis-typed the sheet names - ensure there are no leading or trailing spaces.

    I've attached your file with the necessary amendments. Notice that I have renamed your subsidiary sheets, and put the same names in column B on Sheet1, where the formulae are in columns C and D.

    Hope this helps.

    Pete
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Getting the value from sub sheets

    Thanks Pete_UK,

    its working

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

    Re: Getting the value from sub sheets

    Glad to hear it, and thanks for the rep.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Pete

  10. #10
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Agra
    MS-Off Ver
    Office 2010
    Posts
    241

    Re: Getting the value from sub sheets

    Thanks, Sure bro

+ 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] Codes for Prevent users from adding sheets, deleting sheets, hiding/unhiding sheets
    By geniusufo007 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2017, 11:57 PM
  2. Compare Sheets and Display the previous sheets column in current sheets
    By maddyrafi1987 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 05-09-2017, 04:03 AM
  3. Create New Sheets, Copy New Sheets & Name New Sheets - §8-O
    By Gtrtim112 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-26-2016, 10:58 PM
  4. Programming code : Sheets.Add After:=Sheets(Sheets.Count)
    By Blok , Robert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2015, 05:00 AM
  5. Replies: 1
    Last Post: 10-04-2013, 04:21 AM
  6. Replies: 17
    Last Post: 02-01-2013, 12:20 PM
  7. Macro for filter on protected workbook that works for all sheets, no matter what sheets are named?
    By StargateFanFromWork in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-26-2006, 02:35 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