Form Question

G

Guest

I have the following code which initializes a combo box

For Each cMonth In ws.Range("Month")
With Me.cboPlanMonth
.AddItem cMonth.Value
.List(.ListCount - 1, 1) = cMonth.Offset(0, 1).Value
End With
With Me.cboActMonth
.AddItem cMonth.Value
.List(.ListCount - 1, 1) = cMonth.Offset(0, 1).Value
End With

Next cMonth

What I want to do is if the rangename ActMonth is not empty, populate the
value for cboActMonth with that value. I'd also like to allow the pulldown
if it's possible.

How would I do that?

Thanks
 
G

Guest

Assuming you are uisng Ron's first suggestion:

if not isempty(Range("ActMonth")) then
With Me.cboActMonth
.Value = month(range("ActMonth"))
end with
End if
 

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