#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default combobox

It is a combobox from the controls toolbar. Below is the
change event code I have wrote. The program keeps
stopping, thought, and highlighting: "cmbcc.RowSource =
Sheets("Coding").Range("B4:B12")"




Private Sub cmbmajorarea_Change()
If cmbmajorarea.Value = "Environmental" Then
cmbcc.RowSource = Sheets("Coding").Range("B4:B12")
Else
cmbcc.Value = "2"
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default combobox

Rowsource needs to be text.

so try:
cmbcc.RowSource = Sheets("Coding").Range("B4:B12").Address

or
cmbcc.RowSource = "Coding!" & Sheets("Coding").Range("B4:B12").Address

make sure it is all on one line...
--
sb
"scrabtree" wrote in message
...
It is a combobox from the controls toolbar. Below is the
change event code I have wrote. The program keeps
stopping, thought, and highlighting: "cmbcc.RowSource =
Sheets("Coding").Range("B4:B12")"




Private Sub cmbmajorarea_Change()
If cmbmajorarea.Value = "Environmental" Then
cmbcc.RowSource = Sheets("Coding").Range("B4:B12")
Else
cmbcc.Value = "2"
End If
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default combobox

Better would be:

cmbcc.RowSource =
Sheets("Coding").Range("B4:B12").Address(external: =True)

--
Regards,
Tom Ogilvy

steve wrote in message
...
Rowsource needs to be text.

so try:
cmbcc.RowSource = Sheets("Coding").Range("B4:B12").Address

or
cmbcc.RowSource = "Coding!" & Sheets("Coding").Range("B4:B12").Address

make sure it is all on one line...
--
sb
"scrabtree" wrote in message
...
It is a combobox from the controls toolbar. Below is the
change event code I have wrote. The program keeps
stopping, thought, and highlighting: "cmbcc.RowSource =
Sheets("Coding").Range("B4:B12")"




Private Sub cmbmajorarea_Change()
If cmbmajorarea.Value = "Environmental" Then
cmbcc.RowSource = Sheets("Coding").Range("B4:B12")
Else
cmbcc.Value = "2"
End If
End Sub





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default combobox

Tom,

Thanks for the input but I am not familiar with using 'extermal' reference.

The help file on this is skimpy, could you explain this to me?

Thanks...

--
sb
"Tom Ogilvy" wrote in message
...
Better would be:

cmbcc.RowSource =
Sheets("Coding").Range("B4:B12").Address(external: =True)

--
Regards,
Tom Ogilvy

steve wrote in message
...
Rowsource needs to be text.

so try:
cmbcc.RowSource = Sheets("Coding").Range("B4:B12").Address

or
cmbcc.RowSource = "Coding!" & Sheets("Coding").Range("B4:B12").Address

make sure it is all on one line...
--
sb
"scrabtree" wrote in message
...
It is a combobox from the controls toolbar. Below is the
change event code I have wrote. The program keeps
stopping, thought, and highlighting: "cmbcc.RowSource =
Sheets("Coding").Range("B4:B12")"




Private Sub cmbmajorarea_Change()
If cmbmajorarea.Value = "Environmental" Then
cmbcc.RowSource = Sheets("Coding").Range("B4:B12")
Else
cmbcc.Value = "2"
End If
End Sub







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default combobox

? Range("A1").Address(External:=True)
[Book1]Sheet1!$A$1

Really doesn't require much explanation.

--
Regards,
Tom Ogilvy


"steve" wrote in message
...
Tom,

Thanks for the input but I am not familiar with using 'extermal'

reference.

The help file on this is skimpy, could you explain this to me?

Thanks...

--
sb
"Tom Ogilvy" wrote in message
...
Better would be:

cmbcc.RowSource =
Sheets("Coding").Range("B4:B12").Address(external: =True)

--
Regards,
Tom Ogilvy

steve wrote in message
...
Rowsource needs to be text.

so try:
cmbcc.RowSource = Sheets("Coding").Range("B4:B12").Address

or
cmbcc.RowSource = "Coding!" & Sheets("Coding").Range("B4:B12").Address

make sure it is all on one line...
--
sb
"scrabtree" wrote in message
...
It is a combobox from the controls toolbar. Below is the
change event code I have wrote. The program keeps
stopping, thought, and highlighting: "cmbcc.RowSource =
Sheets("Coding").Range("B4:B12")"




Private Sub cmbmajorarea_Change()
If cmbmajorarea.Value = "Environmental" Then
cmbcc.RowSource = Sheets("Coding").Range("B4:B12")
Else
cmbcc.Value = "2"
End If
End Sub










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
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
combobox into another combobox girlie New Users to Excel 1 September 26th 06 10:31 AM
COMBOBOX smiley New Users to Excel 1 October 12th 05 02:01 PM
combobox Nicky* Excel Programming 3 July 28th 03 09:26 PM
Combobox Scott Excel Programming 2 July 23rd 03 02:49 PM


All times are GMT +1. The time now is 11:15 AM.

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"