Ok, I'm going to do my best to be short and sweet, but I've explored so many options I feel crazy right now...
I have successfully used named dynamic ranges to populate the comboboxes in my userform, and they work beautifully...until I try to use one from a different workbook. I've tried using the vba to open the workbook first, just have the workbook open, using full file location and what feels like a million other things.
So, I used this as the "Referenced Cells" in the named range:
And this as the code to initialize the userform and it works beautifully:
But now when I name a range in a different workbook for a different combobox:
And use this code:
It fails and says :
"Run-time error '9':
Subscript out of range"
Any and ALL feedback, advice, tip or tricks would be so, so, SOOO appreciated!
I have successfully used named dynamic ranges to populate the comboboxes in my userform, and they work beautifully...until I try to use one from a different workbook. I've tried using the vba to open the workbook first, just have the workbook open, using full file location and what feels like a million other things.
So, I used this as the "Referenced Cells" in the named range:
Code:
=OFFSET('GLSPECS!$A$2,0,0,COUNTA('GLSPECS'!$A:$A)-1,1)
And this as the code to initialize the userform and it works beautifully:
Code:
Private Sub UserForm_Initialize()
'Populate Glazing Type Combo Box
Dim rngGLTYPE As Range
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("GLSPECS")
For Each rngGLTYPE In ws.Range("GlazTypeList")
uf_NewDoor.cb_GlazingType.AddItem rngGLTYPE.Value
Next rngGLTYPE
End Sub
But now when I name a range in a different workbook for a different combobox:
Code:
=OFFSET('Rails&Hinges'!$A$2,0,0,COUNTA('Rails&Hinges'!$A:$A)-1,1)
And use this code:
Code:
'Populate Hinge Combo Boxs
Dim rngRailsHinges As Range
Workbooks.Open ("I:\Commercial Projects\2-TEMPLATES\Hardware Cost List.xlsm")
Set ws = Workbooks("I:\Commercial Projects\2-TEMPLATES\Hardware Cost List.xlsm").Worksheets("Rails&Hinges")
For Each rngRailsHinges In ws.Range("RailsHinges")
uf_NewDoor.cboTopRailHinge.AddItem rngRailsHinges.Value
Next rngRailsHinges
It fails and says :
"Run-time error '9':
Subscript out of range"
Any and ALL feedback, advice, tip or tricks would be so, so, SOOO appreciated!