+ Reply to Thread
Results 1 to 4 of 4

Creating two "interdependent, linked" cells on a spreadsheet

Hybrid View

  1. #1
    Registered User
    Join Date
    05-19-2010
    Location
    TX
    MS-Off Ver
    Excel 2007
    Posts
    8

    Creating two "interdependent, linked" cells on a spreadsheet

    I'm not sure if I've used the right terms but here is what I'd like to do:

    I have a spreadsheet (attached) and column B is for "account #" while column C is for "distributor". If possible, I would like for cell C2 to be populated (see list tab) with the appropriate distributor name based on what acct # is selected in B2.

    And vice-versa; I would like cell B2 to be populated with the respective acct # when a specific distributor is selected.

    Is there a way to make these two cells dependent on each other like this? Is what I'm asking clear enough?

    Thanks,

    BR
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Creating two "interdependent, linked" cells on a spreadsheet

    I would use the worksheet_change event to achieve this.


    click on the * Add Reputation if this was useful or entertaining.

  3. #3
    Registered User
    Join Date
    03-05-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Creating two "interdependent, linked" cells on a spreadsheet

    Quote Originally Posted by tony h View Post
    I would use the worksheet_change event to achieve this.
    But how?

  4. #4
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Creating two "interdependent, linked" cells on a spreadsheet

    This sample will help to show you how. Paste this code into the worksheet change event then type into cells A2 or B2 for that sheet
    Private Sub Worksheet_Change(ByVal Target As Range)
        Application.EnableEvents = False
        Select Case Target.Address
        Case "$A$2"
            ActiveSheet.Range("$B$2") = "B is now " & ActiveSheet.Range("$A$2")
        Case "$B$2"
            ActiveSheet.Range("$A$2") = "A results " & ActiveSheet.Range("$B$2")
        End Select
    
        Application.EnableEvents = True
    End Sub

+ 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