B
baha17
Hi all,
Let`s say I have too many worksheet in my workbook.All worsheet
generated by using another userform.In my code i can add item to
listbox.How can I do below code to work for all sheet
Private Sub CommandButton1_Click()
Dim cell As Range
Dim xcell As Range
Dim trd variant
trd = TextBox1.Value
Set xcell = Range("a1:d15")
For Each cell In xcell.Columns(1).Cells
If cell.Value = trd Then
ListBox1.ColumnCount = 2
UserForm1.ListBox1.AddItem cell.Offset(0, 1).Value
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1,
2) = cell.Offset(0, 2)
End If
Next
End Sub
I mean I want to add item to list box for each sheet range("a115"),
is that possible?
thanks for your help
Let`s say I have too many worksheet in my workbook.All worsheet
generated by using another userform.In my code i can add item to
listbox.How can I do below code to work for all sheet
Private Sub CommandButton1_Click()
Dim cell As Range
Dim xcell As Range
Dim trd variant
trd = TextBox1.Value
Set xcell = Range("a1:d15")
For Each cell In xcell.Columns(1).Cells
If cell.Value = trd Then
ListBox1.ColumnCount = 2
UserForm1.ListBox1.AddItem cell.Offset(0, 1).Value
UserForm1.ListBox1.List(UserForm1.ListBox1.ListCount - 1,
2) = cell.Offset(0, 2)
End If
Next
End Sub
I mean I want to add item to list box for each sheet range("a115"),
is that possible?
thanks for your help