Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Trouble manipulating worksheet chosen from combo box

I have filled four combo boxes with the worksheet names from the workbook. I
want to copy a (different) range from each worksheet chosen and paste them
together into a different worksheet within the workbook. I am having trouble
at the point where I am getting the results of the combo box to actually call
the chosen worksheet and get the range. The line of code is:

With cboInv.Range("B2:AF3580") 'cboInv is the first combobox variable

at this point I get this error message:

Run time error '91':
Object variable or With variable block not set

I have the statement "Dim cboInv as Worksheet" at the top of the procedure,
but if I remove that I still get a compile error on the ".Range" part of the
code:

Method or data member not found

It's probably something basic I'm missing; perhaps someone could point it out?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Trouble manipulating worksheet chosen from combo box


"PV Jefe" schreef in bericht
...
I have filled four combo boxes with the worksheet names from the workbook.
I
want to copy a (different) range from each worksheet chosen and paste them
together into a different worksheet within the workbook. I am having
trouble
at the point where I am getting the results of the combo box to actually
call
the chosen worksheet and get the range. The line of code is:

With cboInv.Range("B2:AF3580") 'cboInv is the first combobox variable


If in the combobox i.e. 'Sheet1' is selected, it is just text but it should
be an object.
Try this:

With Worksheets(cboInv.Text).Range("B2:AF3580")





at this point I get this error message:

Run time error '91':
Object variable or With variable block not set

I have the statement "Dim cboInv as Worksheet" at the top of the
procedure,
but if I remove that I still get a compile error on the ".Range" part of
the
code:

Method or data member not found

It's probably something basic I'm missing; perhaps someone could point it
out?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Trouble manipulating worksheet chosen from combo box

Hi moon,

Muchas Gracias - that was perfect! I knew there was some little (!) thing I
needed. I appreciate your help very much!


Reply
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
Go to a chosen worksheet Bob[_16_] Excel Worksheet Functions 1 June 12th 09 12:59 PM
Auto-filtering based on a value chosen in a combo box? Dan Excel Discussion (Misc queries) 0 November 6th 07 03:51 PM
Still Having Trouble with Combo Box mtm4300 via OfficeKB.com Excel Programming 8 February 15th 06 01:55 PM
How do I make Excel worksheet tabs change appearance when chosen . fentrkn Excel Discussion (Misc queries) 1 March 14th 05 05:36 PM
trouble with combo box John Excel Programming 1 June 27th 04 12:01 AM


All times are GMT +1. The time now is 10:29 PM.

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

About Us

"It's about Microsoft Excel"