+ Reply to Thread
Results 1 to 3 of 3

Thread: Dynamically Reference Worksheet Cell/Range

  1. #1
    Barn Frequenter BLaaaaaaaaaarche will become famous soon enough BLaaaaaaaaaarche will become famous soon enough BLaaaaaaaaaarche's Avatar
    Join Date
    Mar 2008
    Posts
    188
    Rep Power
    5

    Dynamically Reference Worksheet Cell/Range

    Okay, I am not sure if this is already a built-in function in Excel, but I have not yet found it. What I need to do, is build a function, so one worksheet can reference another worksheets cell/range dynamically.

    Basically, say I have a worksheet named Summary. In this worksheet, it summarizes a list of part numbers. So, in column A, it will list part numbers. These part numbers each have their own individual worksheet, which is named the same as the part number.

    How do I create a function to reference the name of the other worksheet from the part number in the Summary tab.

    For instance, if I want to reference the worksheet for part number 123456789, and cell B25, how would I build this function. The code in excel to reference such worksheet from another is:

    Code:
    ='123456789'!B25
    
    You cannot create that dynamically, hence why I think I need a function. I would also like the ability to reference a range as well and not just a single cell.
    "You'll never be as perfect as BLaaaaaaaaarche."

  2. #2
    Super Sarcasm Mistress mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere is a glorious beacon of light mehere's Avatar
    Join Date
    Mar 2008
    Location
    Wide Awake In Dreamland
    Posts
    830
    Rep Power
    8

    have a look at the INDIRECT function. something like this:
    Code:
    =INDIRECT(A1& "!B3")
    
    A1 being the field that contains the worksheet name
    B3 being the cell that contains the value.
    Quote of the Month:
    INSIGHT: When the going gets tough, the tough get going. The smart left a long time ago.

    Questions to Ponder:
    Are people more violently opposed to fur rather than leather because it's much easier to harass rich women than motorcycle gangs?

    iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
    copyright © 2008 sbenj69

    Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it.

  3. #3
    Barn Frequenter BLaaaaaaaaaarche will become famous soon enough BLaaaaaaaaaarche will become famous soon enough BLaaaaaaaaaarche's Avatar
    Join Date
    Mar 2008
    Posts
    188
    Rep Power
    5

    Yep, that with a combination of ADDRESS() worked perfectly.

    Thanks, mehere.
    "You'll never be as perfect as BLaaaaaaaaarche."

+ Reply to Thread

Similar Threads

  1. VBScript Functions Reference
    By jmurrayhead in forum ASP Development
    Replies: 25
    Last Post: October 21st, 2008, 09:31 AM
  2. dynamically created dropdowns insert to sql
    By peebman2000 in forum .NET Development
    Replies: 14
    Last Post: May 19th, 2008, 12:00 PM
  3. update gridview dynamically
    By peebman2000 in forum .NET Development
    Replies: 27
    Last Post: May 8th, 2008, 11:03 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

SEO by vBSEO