S
Soniya
Hi All,
I have a UserForm with a ComboBox and Two CommandButtons
ComboBox1 has Item1, Item2, Item3.. Item8 and
CommandButton1 =Print and CommandButton2 = Print Preview
No How can I make code to select for Eg. Item1 then it
selects the specific sheet eg. Sheet("Item1") and do my
code when I click the Command Button?
I have somethinlike this:
userform_initialise
RType = ComboBox1.ListIndex
ComboBox1.SetFocus
With ComboBox1.Object
.Clear
.AddItem "ITEM 1"
.AddItem "ITEM 2"
.AddItem "ITEM 3"
.AddItem "ITEM 4"
.AddItem "ITEM 5"
End With
Sub ReportMain()
Application.ScreenUpdating = False
If RType = 0 Then
Sheets("ITEM 1").Select
PrintR
ElseIf RType = 1 Then
Sheets("ITEM 2").Select
PrintR
ElseIf RType = 2 Then
Sheets("ITEM 3").Select
PrintR
ETC....
End If
TIA
Soniya
I have a UserForm with a ComboBox and Two CommandButtons
ComboBox1 has Item1, Item2, Item3.. Item8 and
CommandButton1 =Print and CommandButton2 = Print Preview
No How can I make code to select for Eg. Item1 then it
selects the specific sheet eg. Sheet("Item1") and do my
code when I click the Command Button?
I have somethinlike this:
userform_initialise
RType = ComboBox1.ListIndex
ComboBox1.SetFocus
With ComboBox1.Object
.Clear
.AddItem "ITEM 1"
.AddItem "ITEM 2"
.AddItem "ITEM 3"
.AddItem "ITEM 4"
.AddItem "ITEM 5"
End With
Sub ReportMain()
Application.ScreenUpdating = False
If RType = 0 Then
Sheets("ITEM 1").Select
PrintR
ElseIf RType = 1 Then
Sheets("ITEM 2").Select
PrintR
ElseIf RType = 2 Then
Sheets("ITEM 3").Select
PrintR
ETC....
End If
TIA
Soniya