E
Excel-Programming
I have a question on this userform. It now loads nicely. Thanks.
Is there a way to add a choice called all to the end of the list?
That way the user can select which name to print or select all. In
the case of all
I need to print all the sheets.
That way it is a simple if/then. if one is selected print that one if
all is selected I will have to capture that.
tnx,
Private Sub UserForm_Initialize()
'Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
'Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")
intLastRow = Cells.Find(What:="*", After:=ws.Range("A1"),
SearchDirection:=xlPrevious).Row
Set rng = Worksheets("patients").Range("A1:A" & intLastRow)
Me.ComboBox2.Clear
For Each c In g_rng
Me.ComboBox2.AddItem c.Value
Next c
End Sub
I took a leap of faith and added Me.ComboBox2.Additem "All" right
under the Me.ComboBox2.Additem c.Value line. What I got was a list
interpersed with "all" instead of only once.
thanks again,
Is there a way to add a choice called all to the end of the list?
That way the user can select which name to print or select all. In
the case of all
I need to print all the sheets.
That way it is a simple if/then. if one is selected print that one if
all is selected I will have to capture that.
tnx,
Private Sub UserForm_Initialize()
'Dim intLastRow As Integer
Dim ws As Worksheet
Dim c As Range
'Dim rng As Range
Set ws = ThisWorkbook.Worksheets("patients")
intLastRow = Cells.Find(What:="*", After:=ws.Range("A1"),
SearchDirection:=xlPrevious).Row
Set rng = Worksheets("patients").Range("A1:A" & intLastRow)
Me.ComboBox2.Clear
For Each c In g_rng
Me.ComboBox2.AddItem c.Value
Next c
End Sub
I took a leap of faith and added Me.ComboBox2.Additem "All" right
under the Me.ComboBox2.Additem c.Value line. What I got was a list
interpersed with "all" instead of only once.
thanks again,