Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 516
Default dropdown menu starting value

i have the code below running a dropdown menu. when certain parameters
change the value last selected for the cell might no longer be available. my
issue is that i need to reset the default value if the previously selected
value is no longer available.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim t, List
For t = 18 To 24
If Cells(t, "H") < "0" Then List = List & "," & Cells(t, "H")
Next
With Range("E14").Validation
.Delete
.Add xlValidateList, Formula1:=List
.InCellDropdown = True
End With
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 695
Default dropdown menu starting value

Try explain ur problem in simpel english - im from Denmark


"Matt" skrev:

i have the code below running a dropdown menu. when certain parameters
change the value last selected for the cell might no longer be available. my
issue is that i need to reset the default value if the previously selected
value is no longer available.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim t, List
For t = 18 To 24
If Cells(t, "H") < "0" Then List = List & "," & Cells(t, "H")
Next
With Range("E14").Validation
.Delete
.Add xlValidateList, Formula1:=List
.InCellDropdown = True
End With
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 695
Default dropdown menu starting value

not sure what u mean ?


"Matt" skrev:

i have the code below running a dropdown menu. when certain parameters
change the value last selected for the cell might no longer be available. my
issue is that i need to reset the default value if the previously selected
value is no longer available.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim t, List
For t = 18 To 24
If Cells(t, "H") < "0" Then List = List & "," & Cells(t, "H")
Next
With Range("E14").Validation
.Delete
.Add xlValidateList, Formula1:=List
.InCellDropdown = True
End With
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default dropdown menu starting value

You could check the contents of cell E14 against the list of values:

With Range("E14")
With .Validation
.Delete
.Add xlValidateList, Formula1:=List
.InCellDropdown = True
End With
If InStr(1, List, .Value) = 0 Then
.ClearContents
End If
End With


Matt wrote:
i have the code below running a dropdown menu. when certain parameters
change the value last selected for the cell might no longer be available. my
issue is that i need to reset the default value if the previously selected
value is no longer available.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim t, List
For t = 18 To 24
If Cells(t, "H") < "0" Then List = List & "," & Cells(t, "H")
Next
With Range("E14").Validation
.Delete
.Add xlValidateList, Formula1:=List
.InCellDropdown = True
End With
End Sub



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Dropdown menu without using the Validation on the Data Menu lostinformulas Excel Worksheet Functions 0 July 13th 06 08:47 PM
Missing Menu Bar When Starting Excel MattB Excel Discussion (Misc queries) 4 July 7th 06 03:10 PM
DropDown Menu Well Missy Excel Worksheet Functions 2 March 28th 06 05:28 AM
dropdown menu or Jump menu the dude Excel Discussion (Misc queries) 1 March 26th 06 07:58 PM
Dropdown menu keisha Excel Discussion (Misc queries) 1 April 8th 05 09:03 PM


All times are GMT +1. The time now is 02:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"