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

I have a number of combo boxes set up in a worksheet and Excel has
intermittently generated the 'Error 1004: Select method of Range class
failed' message when attempting to save the file after making changes to the
combo boxes.

Last week your forum advised that the following code (set up for each box
and where the debug command takes me from the error message) was the likely
source of the problem:

Private Sub ComboBox1_Change()
Range("C10").Select
End Sub

The ranges specified as above are all supposed to be in the same worksheet
as the combo boxes (N.B. the ListFillRange for the boxes are located in a
different worksheet).

The forum suggested that the range needs to be more fully qualified in the
code so that Excel doesn't get confused about the ActiveSheet.

What would you recommend as the best code for accomplishing this (as there
are so many different ways to do it)?

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

It just needs to know which C10 you mean, there are potentially many across
the sheets. This is an example:
Sheets("Main").Range("C10").Select
That is if you have the sheet name or simply
Sheets(1).Range("C10").Select
if the name may change or you want to use a variable.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"R Ormerod" wrote:

I have a number of combo boxes set up in a worksheet and Excel has
intermittently generated the 'Error 1004: Select method of Range class
failed' message when attempting to save the file after making changes to the
combo boxes.

Last week your forum advised that the following code (set up for each box
and where the debug command takes me from the error message) was the likely
source of the problem:

Private Sub ComboBox1_Change()
Range("C10").Select
End Sub

The ranges specified as above are all supposed to be in the same worksheet
as the combo boxes (N.B. the ListFillRange for the boxes are located in a
different worksheet).

The forum suggested that the range needs to be more fully qualified in the
code so that Excel doesn't get confused about the ActiveSheet.

What would you recommend as the best code for accomplishing this (as there
are so many different ways to do it)?

Thanks
--
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
Combo box problem R Ormerod Excel Discussion (Misc queries) 3 August 13th 07 09:52 AM
Simple combo box problem JonathanW Excel Discussion (Misc queries) 1 March 23rd 07 11:53 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 07:03 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"