Results 1 to 3 of 3

clear data validation drop down based on text in another cell

Threaded View

lilsnoop clear data validation drop... 06-27-2021, 11:43 PM
jindon Re: clear data validation... 06-28-2021, 12:32 AM
lilsnoop Re: clear data validation... 06-28-2021, 12:36 PM
  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2021
    Posts
    974

    clear data validation drop down based on text in another cell

    I was hoping for some assistance with some vba to clear a drop down data validation selection which is in merged cells I3:L3 specifically when cell H2 equals TRUE. If cell H2 equals FALSE I want the name selected in the drop down menu that is visible to remain visible. I tried the following code, which I found online but it didn't work:
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim rng1 As Range
    
    Dim rng2 As Range
    
    Set rng1 = Me.Range("H2")
    
    Set rng2 = Me.Range("I3:L3")
    
    '   Restrict the event change detection to only cell A1
    
    If Not Intersect(Target, rng1) Is Nothing Then
    
        Application.EnableEvents = False ' Prevent macro looping
    
        If LCase(rng1.Value) = True Then
    
            rng2.ClearContents
    
        Else
    
        End If
    
       End If
    
    End Sub
    Appreciate your time and help!
    Attached Files Attached Files
    Last edited by lilsnoop; 06-28-2021 at 12:37 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Clear contents of validation based on a cell
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2016, 08:33 AM
  2. Clear cell contents of drop down box based on condition
    By Pami in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2015, 12:05 PM
  3. [SOLVED] Data Validation: How to clear/delete the content of the cell and not Data Validation List?
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-07-2015, 09:42 AM
  4. Replies: 3
    Last Post: 08-16-2014, 09:55 AM
  5. Populate cell data based on data validation (drop down list)
    By ish_baho in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-05-2014, 11:47 PM
  6. [SOLVED] Data validation based on another cell containing specific text
    By Sph01 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-06-2013, 05:51 AM
  7. Replies: 1
    Last Post: 06-21-2013, 04:05 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