Range error when referencing non active worksheet
cmbxOperation.RowSource = RngOp.Address(External:=True)
I would suggest using Jim Cones Approach as it should be faster I would
think
Private Sub cmbxOperation_DropButtonClick()
With Worksheets("Operation")
RwOp = .Range("H65536").End(xlUp).Row
Set RngOp = .Range(.Cells(2, 8),.Cells(5, RwOp))
End With
cmbxOperation.RowSource = _
RngOp.Address(External:=True)
End Sub
--
Regards,
Tom Ogilvy
"SP" wrote in message
oups.com...
Jim and Leith, I tried both suggestions and both methods eliminated the
error.
However I have multiple ComboBoxes which pull data from different
Worksheets and all the ComboBoxes are puliing the data from
"Worksheets(1)", the row and column paramaters are working propwerly.
The code for the other ComboBox is:
Private Sub cmbxOperation_DropButtonClick()
RwOp = Worksheets("Operation").Range("H65536").End(xlUp). Row
Set RngOp = Worksheets("Operation").Range(Cells(2, 8).Address,
Cells(5, 8).Address)
cmbxOperation.RowSource = RngOp.Address
End Sub
Once again thanks for the help.
Sal
|