Earlyfreak
New Member
- Joined
- Jan 31, 2017
- Messages
- 16
I have a listbox on a Useform in VBA and I have the listbox load as RowSource from tbl_Exercises
It loads all exercises and muscle groups in listbox
I have buttons on Userform to select a muscle group
Example
Private Sub B_NewYork_Click()
Sheets("Data").ListObjects("tbl_Data").Range.AutoFilter Field:=1
Sheets("Data").ListObjects("tbl_Data").Range.AutoFilter Field:=1, _
Criteria1:="Biceps"
End Sub
This filters the table, however it does not update the listbox on form
I tried using this code to maybe just show visible filtered table but did not work
Private Sub UserForm_Initialize()
Listbox1.RowSource = Sheets("Data").Range("D7").CurrentRegion.Select
End Sub
I looking to filet listbox based on form button and only show that muscle group
Any direct on how to update listbox to only show filtered table RowSource?
It loads all exercises and muscle groups in listbox
I have buttons on Userform to select a muscle group
Example
Private Sub B_NewYork_Click()
Sheets("Data").ListObjects("tbl_Data").Range.AutoFilter Field:=1
Sheets("Data").ListObjects("tbl_Data").Range.AutoFilter Field:=1, _
Criteria1:="Biceps"
End Sub
This filters the table, however it does not update the listbox on form
I tried using this code to maybe just show visible filtered table but did not work
Private Sub UserForm_Initialize()
Listbox1.RowSource = Sheets("Data").Range("D7").CurrentRegion.Select
End Sub
I looking to filet listbox based on form button and only show that muscle group
Any direct on how to update listbox to only show filtered table RowSource?