LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error referencing linked dynamic range Basil Links and Linking in Excel 3 January 9th 10 01:48 PM
Referencing cell in active row pskwaak Excel Worksheet Functions 1 March 17th 07 11:49 PM
referencing the active cell Jim O[_4_] Excel Programming 2 July 15th 05 10:16 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Setting a range value to the last cell in active worksheet. Don Excel Programming 3 June 24th 04 02:04 PM


All times are GMT +1. The time now is 02:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"