Thread: Input Box List
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pauluk[_15_] pauluk[_15_] is offline
external usenet poster
 
Posts: 1
Default Input Box List

Hi Peeps,

What i want to to do is have a list to select from. I use a input bo
for monthly outputs where you type the actuall month. Instead of doin
this i want a list box so that you just clcik on the month then ok. Th
code am using is as follows:

Dim rng As Range
Dim rng2 As Range
Dim strMONTH As String
strMONTH = Application.InputBox("Please Select the month you wish t
compare.", "Monthly Output")

Selection.AutoFilter Field:=10, _
Criteria1:="=" & (strMONTH)

With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng2 = .SpecialCells(xlCellTypeVisible)
On Error GoTo 0
End With
If rng2 Is Nothing Then
MsgBox "No info for that month"
Else
Worksheets("Monthly Output").Cells.Clear
Set rng = ActiveSheet.AutoFilter.Range
rng.Copy Destination:=Worksheets("Monthly Output").Range("A1")
End If
ActiveSheet.ShowAllDat

--
Message posted from http://www.ExcelForum.com