+ Reply to Thread
Results 1 to 7 of 7

Dropdown dependencies

Hybrid View

  1. #1
    Registered User
    Join Date
    11-09-2010
    Location
    Birmingham
    MS-Off Ver
    Excel 2003
    Posts
    23

    Dropdown dependencies

    Hi All
    Hoping someone can help with a small problem I have?
    I have a 2 worksheet file & both sheets are multi column.
    Sheet 1 has a combination of drop downs & free txt fields but no calculations and feeds Sheet 2 has various formula and no direct entry into its fields.
    Sheet1 Col R (Dropdown) feeds Sheet2 Col AA & Sheet1 Col K (yes/no dropdown) feeds Sheet2 Col S.
    What I need to do is retain the normal usability but with the added that if Col R is selected it not only puts the normal feed through to sheet 2 col AA but also selects "No" in sheet2 Col S.
    If you've managed to understand what I'm aiming at, is it possible & how????
    Many many thanks for your anticipated help.

    araujo
    Last edited by Araujo1958; 12-16-2010 at 10:06 AM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Dropdown dependencies

    Details are lacking, but perhaps this will do what you want.
    When a cell in column-R on sheet1 is selected (no changed), it make the cell in column-AA of sheet2 have a value of "No", using the same row as the selected cell.

    This code must go into the worksheet module of Sheet1.
    Note: sheet references are sheet code names, not worksheet (tab) names.

    Option Explicit
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
        If Target.Cells.Count > 1 Then Exit Sub
        
        If Not Intersect(Target, Columns("R:R")) Is Nothing Then
            Sheet2.Range("AA" & Target.Row).Value = "No"
        End If
        
    End Sub
    If this is not what you intended, then state your requirements more precisely and with more details, or upload a sample workbook that shows the desired results.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    11-09-2010
    Location
    Birmingham
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Dropdown dependencies

    Palmetto, thank you for your response which unfortunately does not appear to do what I require.
    However, I think I was looking at this in slightly the wrong way. As "Sheet 1" feeds "Sheet 2" I can ignore Sheet 2. So the question is whilst still retaining an optional Y/N dropdown in Column K if Column R is selected and populated via a dropdown (with the options of Amendment or Adjustment) is it then possible for Column K to automatically default to "No"?
    Hope that this is slightly clearer than my first attempt to explain.

    Regards
    Araujo

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Dropdown dependencies

    Revised code, which uses the worksheet_change event.
    If the changed cell is in column-R and the cell value is not a null value then cell-K of the same row is change to "No".

    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
    
        If Target.Cells.Count > 1 Then Exit Sub
        
        If Not Intersect(Target, Columns("R:R")) Is Nothing Then
            If Target <> vbNullString Then
                Range("K" & Target.Row) = "No"
            End If
        End If
    
    End Sub

  5. #5
    Registered User
    Join Date
    11-09-2010
    Location
    Birmingham
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Dropdown dependencies

    Palmetto,appreciated and I'm sure it's me but I inserted the code you provided via the VBA editor. I then entered text via the dropdown menu in column "R" and nothing appeared in Column "K". I'm sure I am doing something stupid...... once again HELP!!!
    Thank You.

  6. #6
    Registered User
    Join Date
    11-09-2010
    Location
    Birmingham
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Dropdown dependencies

    You are brilliant, worked a treat.
    Thank you.

  7. #7
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Dropdown dependencies

    Did you put the code into the worksheet module? That is where it must go.

    If not, then:

    Right-click the worksheet tab and choose View Code
    Copy and paste the code into the code pane (normally on the right side of the screen)
    Close the VB Editor

+ 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