+ Reply to Thread
Results 1 to 5 of 5

Code referencing another Cell

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Code referencing another Cell

    Hello,

    Is it possible to reference code in another cell? I'm looking to change code in one cell and it reflects in others. I want to change B2:B16 in A2 and it change the B2:B16 in C2,E2,and G2. Is this possible?

    Here is the exact code I have in the following cells.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Code referencing another Cell

    Perhaps use 'named ranges'

    http://www.contextures.com/xlNames01.html

    This will automatically update all ranges once the 'named range' is edited
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Code referencing another Cell

    I didn't think of that. I named a range, but I'm unsure on how to add it into my formulas?

  4. #4
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Code referencing another Cell

    I'm not sure if a named range is going to work if I understand it correctly. I have D9 named to August.

    In D9, I have B45:66

    I changed the formula to
    Please Login or Register  to view this content.
    which returns 0. This is not correct. I think the named range needs to be a value?

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Code referencing another Cell

    Use INDIRECT.

    For example if you had B45:B66 n D9 and you wanted that to replace B2:B16 in the formulas.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  6. #6
    Registered User
    Join Date
    12-18-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Code referencing another Cell

    That works perfectly! Thank you.

+ 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] Complicated Cell referencing Calculation code Help NEEDED
    By olewilers in forum Excel General
    Replies: 2
    Last Post: 06-28-2012, 11:28 AM
  2. Referencing a specific cell after found using VB code
    By phaley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2008, 07:07 PM
  3. code for cell referencing in VBA
    By KK1811 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-30-2007, 03:21 AM
  4. absolute cell referencing in VBA code
    By phuang1226 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2007, 11:57 PM
  5. Cell Referencing Code Error?
    By MPS0525 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-17-2006, 11:45 AM

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