combobox

S

scrabtree

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
 
S

steve

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...
 
T

Tom Ogilvy

Better would be:

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

steve

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...
 
T

Tom Ogilvy

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

Really doesn't require much explanation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top