+ Reply to Thread
Results 1 to 4 of 4

Macro:Extract value from specific cells in different worksheet named in column A

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    BC, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Macro:Extract value from specific cells in different worksheet named in column A

    Hi there, I apologize for the confusing title thread as I didn't know how to better explain it. I'm completely new to VB but know of its potential and have used simpler codes to enhance work performance. I'm working on a training costs spreadsheet. I'm looking for a code (macro) that would allow me to select data from a worksheet named in column "a" of the active worksheet and copy that value back into the active worksheet. E.g. Active worksheet is named "Summary". Second worksheet is named "Leadership". I am in column "c5" (Summary) and want to select the worksheet named in column "a5" (Summary) which happens to be "Leaderhsip". I want to the code to go to the "Leadership" spreadsheet and extract a value from cell g3 and return it to cell c5 in "Summary". I want to then have column d5 in "Summary" return a value from cell g4 in "Leadership" and so on.... I have various worksheets and want to run this individual maro on each row separately in the "Summary" worksheet as I add rows with worksheet names. The values being returned are calculated values and I want the values in the "Summary" worksheet to update automatically based on the values in the other worksheets. I do not want to manually input a cell reference formula each time.

    I have attached a sample spreadsheet for reference.TrainingSample.xlsx


    Any and all assistance would be greatly appreciated!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro:Extract value from specific cells in different worksheet named in column A

    Why do you want to do it with a macro?

    You can get your results with simple index & match formulae.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    06-19-2012
    Location
    BC, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro:Extract value from specific cells in different worksheet named in column A

    Thanks Arlette,

    I googled index and match formulas but can't find an example where I can input a formula to refer to a worksheet name listed in column A. I tried to modify the sample formulas but still haven't been able to get it to work. Are you able to provide a sample formula I can input into cell c5 of the Summary worksheet that will have it refer to the worksheet listed in a5 (Leadership), cell g3?

    I tried to commence the formula with index('a5:a6,1,1'!)...to attempt a formula to refer to the worksheet named in column A so it will change/update when I copy the formula down.

  4. #4
    Registered User
    Join Date
    06-19-2012
    Location
    BC, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro:Extract value from specific cells in different worksheet named in column A

    Thanks Arlette,

    I found an "indirect" formula that works =INDIRECT("'"&A5&"'!g3")

    Your response got me thinking outside the box and I was able to find a formula to suit my needs...

+ 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