Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Form Question

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Form Question

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

--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote:

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

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
Form question Rich Mogy Excel Discussion (Misc queries) 2 February 16th 07 06:14 PM
Form Question trward79 Excel Programming 0 October 10th 06 10:05 PM
Form Question tssgw[_3_] Excel Programming 1 June 8th 06 09:37 PM
Form question [email protected] Excel Programming 2 October 28th 03 02:41 AM
ser form question Gareth[_3_] Excel Programming 1 September 11th 03 09:27 PM


All times are GMT +1. The time now is 10:31 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"