+ Reply to Thread
Results 1 to 4 of 4

How to pre-select a list item based on a cell value from another worksheet using VBA

  1. #1
    Registered User
    Join Date
    01-02-2017
    Location
    Toronto, Canada
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    6

    How to pre-select a list item based on a cell value from another worksheet using VBA

    Hello,

    I have identical dropdown lists on 2 different worksheets. I would like to have the selected value from the 1 worksheet to be pre-selected on the other worksheet upon moving to that worksheet.

    This is the VBA code i have on the worksheets right now:

    Private Sub Worksheet_Activate()
    If Range("C6").Value2 <> "WEEK" Then
    Application.EnableEvents = False
    Range("C6").Value2 = "WEEK"
    Application.EnableEvents = True
    End If
    End Sub

    Private Sub Worksheet_Change(ByVal Target As Range)
    On Error Resume Next
    If Not Intersect(Target, Range("C6")) Is Nothing Then
    Application.ScreenUpdating = False
    Sheets(Range("AB13").Value).Select
    Application.ScreenUpdating = True
    End If
    End Sub

    Ideally when they change the 'WEEK' dropdown list item to either 'MTD', 'QTD' or 'YTD' (this switches the worksheet to the 'MTD/QTD/YTD' worksheet) one of the actions is to carry over the selected District or Branch from the applicable dropdown list from the 'WEEK' worksheet to the duplicate dropdown list in the 'MTD/QTD/YTD' worksheet.

    Hopefully you can envision this and I haven't confused you.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How to pre-select a list item based on a cell value from another worksheet using VBA

    It would be helpful if you could attach a sample of what you are working with....it would help us to "envision" everything that is going on so we can better assist you.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    01-02-2017
    Location
    Toronto, Canada
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    6

    Re: How to pre-select a list item based on a cell value from another worksheet using VBA

    I figured it out. I just needed to update "WEEK" to Worksheets("Worksheet Name").Range("Cell Reference from dropdown you want pre-filled").

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: How to pre-select a list item based on a cell value from another worksheet using VBA

    Glad you were able to get it figured out.

+ 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. Replies: 5
    Last Post: 04-11-2014, 03:13 PM
  2. Macro to select worksheet based on cell value and then return data to diff worksheet
    By clnossok in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2013, 07:48 PM
  3. Replies: 0
    Last Post: 11-13-2012, 12:53 PM
  4. Select Combobox Item With List Item Select
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-22-2011, 02:40 PM
  5. Taking the next item in a list into 1 of 2 tables based on the previous item time
    By SoleAris in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2011, 04:59 PM
  6. linking a list item or text item in a user form to a worksheet
    By ravergirl7216 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-03-2010, 03:43 AM
  7. [SOLVED] Last list item selected in a Multi-Select list box?
    By Brian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2005, 05:15 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