View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Matt Matt is offline
external usenet poster
 
Posts: 516
Default Excel Script for Drop Down Menu

i some kind person gave me the code below to insert into my spreadsheet to
remove the white space from my drop down menus. the issue is that i have 15
of these on the same page. can i just copy and
paste the same codes below the first (changing names and fields of course),
or do i need to make a new module? Please advise.

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


Matt