#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Combo box problem

I have the following VBA set up for a range of combo boxes in a worksheet:

Private Sub ComboBox15_Change()

Range("C121").Select

End Sub

When trying to save the file I intermittently get the 'Select method of
Range class failed' message and the debug command takes me to the VBA for one
of my combo boxes, as above.

The only way round this I have so far found is to delete the code relating
to the affected box, but I would rather not have to do this.

--
R Ormerod
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Combo box problem

Maybe...

application.goto me.range("c121")



R Ormerod wrote:

I have the following VBA set up for a range of combo boxes in a worksheet:

Private Sub ComboBox15_Change()

Range("C121").Select

End Sub

When trying to save the file I intermittently get the 'Select method of
Range class failed' message and the debug command takes me to the VBA for one
of my combo boxes, as above.

The only way round this I have so far found is to delete the code relating
to the affected box, but I would rather not have to do this.

--
R Ormerod


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 149
Default Combo box problem

Where is Range("C121")? What sheet?

Now, tell that to Excel.

In my experience, the most common cause of Error 1004, or any "yada method
of Range class failed", is that the Range hasn't been fully qualified. Excel
will try to use "ActiveSheet" as the default when it can, but that isn't
always feasible and it can get confused fairly easily.

....and when Excel gets confused, it generates error messages (which is why
the error is intermittent: maybe there is no activesheet at that point in
time, or the activesheet is a chart rather than a worksheet, etc.).


HTH,


"R Ormerod" wrote in message
...
I have the following VBA set up for a range of combo boxes in a worksheet:

Private Sub ComboBox15_Change()

Range("C121").Select

End Sub

When trying to save the file I intermittently get the 'Select method of
Range class failed' message and the debug command takes me to the VBA for
one
of my combo boxes, as above.

The only way round this I have so far found is to delete the code relating
to the affected box, but I would rather not have to do this.

--
R Ormerod



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Combo box problem

These ranges are all in the same worksheet as the combo boxes but the List
FillRange and LinkedCell for each box are in different worksheets.

What is the best code for selecting the active worksheet before selecting
the range to overcome this problem?

--
R Ormerod


"George Nicholson" wrote:

Where is Range("C121")? What sheet?

Now, tell that to Excel.

In my experience, the most common cause of Error 1004, or any "yada method
of Range class failed", is that the Range hasn't been fully qualified. Excel
will try to use "ActiveSheet" as the default when it can, but that isn't
always feasible and it can get confused fairly easily.

....and when Excel gets confused, it generates error messages (which is why
the error is intermittent: maybe there is no activesheet at that point in
time, or the activesheet is a chart rather than a worksheet, etc.).


HTH,


"R Ormerod" wrote in message
...
I have the following VBA set up for a range of combo boxes in a worksheet:

Private Sub ComboBox15_Change()

Range("C121").Select

End Sub

When trying to save the file I intermittently get the 'Select method of
Range class failed' message and the debug command takes me to the VBA for
one
of my combo boxes, as above.

The only way round this I have so far found is to delete the code relating
to the affected box, but I would rather not have to do this.

--
R Ormerod




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
Simple combo box problem JonathanW Excel Discussion (Misc queries) 1 March 23rd 07 11:53 AM
Problem Adding new Combo Boxes [email protected] Excel Discussion (Misc queries) 2 September 12th 06 09:58 AM
Combo Box properties problem Simon205 Excel Worksheet Functions 2 May 23rd 06 10:13 AM
combo box problem in Excel Tvnguye Excel Discussion (Misc queries) 1 December 23rd 05 03:37 AM
Combo Box problem tmjhiphopcom Excel Discussion (Misc queries) 2 November 6th 05 05:30 PM


All times are GMT +1. The time now is 08:31 AM.

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"