Drop Lst - Defined Range 'Select Value' message in formula and not in defined list

mattbarb

Board Regular
Joined
Mar 22, 2018
Messages
54
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I have a defined list as a drop down. Is there a way to add to the top of the list something like 'Select Value' in the formula and not in the defined list?

Many thanks
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
load the list , then set the 'select' text:

Code:
Me.ComboBox1.List = Sheets("data").Range("A2:A" & ActiveSheet.UsedRange.Rows.Count).Value
Me.ComboBox1 = "Select 1"
 
Last edited by a moderator:
Upvote 0
Sorry how would that look with a defined list. Couldnt get it to work.
 
Upvote 0
Based on your Named Range being called "myList" and you wanting to add to that list a Header like "Select value" and you validation cell being "C1" then try this, "Double Click event" in your sheet module.

" loading code "
Right click sheet tab, select View Code, vb window appears,Paste code into Code window.

"Run Code"
Double click "C1" to see modified List"
After selecting value. To reset "Select Value", Double click "C1" again.
Code:
Private [COLOR=navy]Sub[/COLOR] Worksheet_BeforeDoubleClick(ByVal Target [COLOR=navy]As[/COLOR] Range, Cancel [COLOR=navy]As[/COLOR] Boolean)
[COLOR=navy]Dim[/COLOR] Txt [COLOR=navy]As[/COLOR] [COLOR=navy]String[/COLOR]

Txt = "Select Value" & "," & Join(Application.Transpose(Range("MyList")), ",")
[COLOR=navy]With[/COLOR] [c1].Validation
    .Delete
    .Add Type:=xlValidateList, Formula1:=Txt
    .ShowError = False
[COLOR=navy]End[/COLOR] With
[c1] = "Select Value"
[COLOR=navy]End[/COLOR] [COLOR=navy]Sub[/COLOR]
Regards Mick
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top