+ Reply to Thread
Results 1 to 10 of 10

How do I have excel add an drop down list if the cell before it is populated with text?

Hybrid View

  1. #1
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How do I have excel add an drop down list if the cell before it is populated with text

    
    
    Private Sub CheckBox1_Click()
    
    If CheckBox1.Value = True Then
        
    LC = Sheets("Run Table").Cells(1, Columns.Count).End(xlToLeft).Column
    
        With Range("D8").Validation
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
            xlBetween, Formula1:="='Run Table'!$A$1:" & Cells(1, LC).Address
            .IgnoreBlank = True
            .InCellDropdown = True
            .InputTitle = ""
            .ErrorTitle = ""
            .InputMessage = ""
            .ErrorMessage = ""
            .ShowInput = True
            .ShowError = True
        End With
        
         Range("C8").Value = "Select the column in your run table that corresponds with resin type"
         Range("D8").Select
         SendKeys "%{DOWN}"
         
    Else
    
        With Range("D8").Validation
            .Delete
            .Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
            :=xlBetween
            .IgnoreBlank = True
            .InCellDropdown = True
            .InputTitle = ""
            .ErrorTitle = ""
            .InputMessage = ""
            .ErrorMessage = ""
            .ShowInput = True
            .ShowError = True
        End With
    
        Range("C8").Value = ""
             Range("D8").Select
             
     End If
        
    End Sub
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  2. #2
    Registered User
    Join Date
    04-13-2020
    Location
    MD
    MS-Off Ver
    2018
    Posts
    19

    Re: How do I have excel add an drop down list if the cell before it is populated with text

    Followup question: how do I make the dropdown disappear if I uncheck the checkbox after checking it?

+ 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. Drop Down List & Dependent Values to be populated
    By Sachin.Hardikar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-07-2019, 01:16 PM
  2. [SOLVED] Pre-populated drop-down list from selection made in drop-down list
    By jmaggols in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-15-2015, 12:26 PM
  3. [SOLVED] Drop Down List populated from Index Match
    By jonesyp in forum Excel General
    Replies: 6
    Last Post: 03-03-2014, 03:23 AM
  4. Replies: 0
    Last Post: 02-03-2013, 06:33 PM
  5. [SOLVED] Drop-down list Populated by a Subset of a larger list
    By RJH in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-11-2010, 07:17 AM
  6. Drop-down list populated by SQL recordset?
    By LadyReader in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-09-2009, 08:33 AM
  7. Can a cell have a drop down list and can also be auto populated
    By Adrian in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-17-2005, 02:06 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