BMAK
12-18-2008, 06:11 AM
Hi guys,
I am trying to create an input box that will provide the user with a drop down menu to select a month, I currently have an input box where the user types in the Month but would like to suppress this due to the likelihood of errors and also for useability. I just dont know where to start to get the drop down list have seen some code but that seems to take the information from a sheet in the excel file, i would like the months to be imbedded in the code.
Any help would be greatly appreciated, even a template of the code that shows the box with a dropdown list that i could modify for my own use.
Thanks,
Here is my current code:
Sub rpl()
Sheets("Dimensions").Select
Range("A1:E91").Select
What = Range("B6")
repl = InputBox("What Month would you like to view?")
If repl = "" Then
MsgBox ("No Month was entered")
Exit Sub
End If
Cells.Replace What:=What, Replacement:=repl, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
I am trying to create an input box that will provide the user with a drop down menu to select a month, I currently have an input box where the user types in the Month but would like to suppress this due to the likelihood of errors and also for useability. I just dont know where to start to get the drop down list have seen some code but that seems to take the information from a sheet in the excel file, i would like the months to be imbedded in the code.
Any help would be greatly appreciated, even a template of the code that shows the box with a dropdown list that i could modify for my own use.
Thanks,
Here is my current code:
Sub rpl()
Sheets("Dimensions").Select
Range("A1:E91").Select
What = Range("B6")
repl = InputBox("What Month would you like to view?")
If repl = "" Then
MsgBox ("No Month was entered")
Exit Sub
End If
Cells.Replace What:=What, Replacement:=repl, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub