+ Reply to Thread
Results 1 to 3 of 3

Radio button controls with 2-dimensional lookup

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-06-2018
    Location
    Virginia
    MS-Off Ver
    2019
    Posts
    342

    Radio button controls with 2-dimensional lookup

    Experts:

    I need some assistance with radio button controls using a "two-dimensional" lookup. Please find attached two tabs where tab "Original" includes an example of radio button lookups.

    However, the 2nd tab "Problem" focuses on what I need to accomplish, such as listed below:

    *****************************

    Background:
    - Similar to the original process, I would like to use radio buttons in order to "drive" a table update.
    - Now, in contrast to the original process though, I need a *2D* lookup.

    Lookup Data (merely example data for demo purposes):
    - I have 3 organizations... Alpha, Bravo, Charlie.
    - For demo purposes only, each of the 3 organizations have 3 schedules (M, T, W)
    - As you can see, the data in cell ranges (B4:D6), (B9:D11), and (B14:D16) is distinct.

    What I want to achieve:
    1. From the radio group "Org" I want to select "Alpha" or "Bravo" or "Charlie"
    2. From the radio group "Schedule", I want to select "M" or "T" or "W"
    3. Based on that two-dimensional selection, I want to display the correct data in cell range G4:J6.
    4. Ideally, based on radio group "Org", I also would like to display either "Alpha" or "Bravo" or "Charlie in cell G3.

    *****************************

    How can steps 1:4 be accomplished?

    Thank you in advance,
    EEH
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,313

    Re: Radio button controls with 2-dimensional lookup

    Small macro intercepting the state of buttons in 'schedule group'

    Option Explicit
    
    Sub RGO()
      If Application.Caller = "optM" Then
      Sheet1.Range("H4:J6").ClearContents
      If [I15] = 1 And [G15] = 1 Then [H4] = [B4]: [H5] = [B5]: [H6] = [B6]: [G3] = "Alpha"
      If [I15] = 1 And [G15] = 2 Then [H4] = [B9]: [H5] = [B10]: [H6] = [B11]: [G3] = "Bravo"
      If [I15] = 1 And [G15] = 3 Then [H4] = [B14]: [H5] = [B15]: [H6] = [B16]: [G3] = "Charlie"
      End If
     If Application.Caller = "optT" Then
     Sheet1.Range("H4:J6").ClearContents
     If [I15] = 2 And [G15] = 1 Then [I4] = [C4]: [I5] = [C5]: [I6] = [C6]: [G3] = "Alpha"
      If [I15] = 2 And [G15] = 2 Then [I4] = [C9]: [I5] = [C10]: [I6] = [C11]: [G3] = "Bravo"
      If [I15] = 2 And [G15] = 3 Then [I4] = [C14]: [I5] = [C15]: [I6] = [C16]: [G3] = "Charlie"
      End If
      If Application.Caller = "optW" Then
      Sheet1.Range("H4:J6").ClearContents
      If [I15] = 3 And [G15] = 1 Then [J4] = [D4]: [J5] = [D5]: [J6] = [D6]: [G3] = "Alpha"
      If [I15] = 3 And [G15] = 2 Then [J4] = [D9]: [J5] = [D10]: [J6] = [D11]: [G3] = "Bravo"
      If [I15] = 3 And [G15] = 3 Then [J4] = [D14]: [J5] = [D15]: [J6] = [D16]: [G3] = "Charlie"
      End If
    End Sub

  3. #3
    Forum Contributor
    Join Date
    08-06-2018
    Location
    Virginia
    MS-Off Ver
    2019
    Posts
    342

    Re: Radio button controls with 2-dimensional lookup

    torachan - thank you... appreciate your providing me the macro.

+ 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] VBA button to Save Radio-button and clear.
    By horsefish01 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2015, 01:17 PM
  2. Sum with Two Dimensional lookup
    By aunakhtar in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-30-2015, 09:52 PM
  3. Replies: 0
    Last Post: 06-10-2014, 10:44 PM
  4. Linking a VBA Form Radio Button to a Option Button
    By buwa84 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2014, 01:46 PM
  5. [SOLVED] How do I lock a radio button group if a N/A button is selected
    By worry a lot in forum Excel General
    Replies: 3
    Last Post: 08-28-2013, 05:39 AM
  6. Uncheck Radio Button using a Command Button
    By earl54dink in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-08-2008, 05:47 PM
  7. Pressing one radio button to select another radio button
    By raehippychick in forum Excel General
    Replies: 1
    Last Post: 09-13-2007, 11:30 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