I originally set up a sheet with Control Toolbox comboboxes, but would now like to move all of those comboboxes to a userform. I'm having trouble referencing a combobox that is located on a userform from a MODULE. Here is my code that's located IN A MODULE (where the first 3 dots represent more code in the subroutine that's irrelevant:
Sub SpecificGravity()
Dim LRow As Long
Dim LRowSave As Long
...
Sheets("Sheet1").Select
ActiveSheet.Shapes("ComboBox1").Select
Selection.ListFillRange = "'Elasticity'!$B$" & LRowSave & ":$D$" & LRow
End Sub
The above worked fine for populating a combobox located on a sheet.
Instead of filling ComboBox1 located on Sheet1, I want to fill ComboBox3 located in UserForm1. What code would I use? Something like:
UserForm1.ComboBox3.ListFillRange = "'Elasticity'!$B$" & LRowSave & ":$D$" & LRow
and delete the lines:
Sheets("Sheet1").Select
ActiveSheet.Shapes("ComboBox1").Select
This doesn't work.
Sub SpecificGravity()
Dim LRow As Long
Dim LRowSave As Long
...
Sheets("Sheet1").Select
ActiveSheet.Shapes("ComboBox1").Select
Selection.ListFillRange = "'Elasticity'!$B$" & LRowSave & ":$D$" & LRow
End Sub
The above worked fine for populating a combobox located on a sheet.
Instead of filling ComboBox1 located on Sheet1, I want to fill ComboBox3 located in UserForm1. What code would I use? Something like:
UserForm1.ComboBox3.ListFillRange = "'Elasticity'!$B$" & LRowSave & ":$D$" & LRow
and delete the lines:
Sheets("Sheet1").Select
ActiveSheet.Shapes("ComboBox1").Select
This doesn't work.