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 Setting default value for combo box

I'm populating the values for a combo box using the following:

With Me.cboPlanMonth
.AddItem cMonth.Value
.List(.ListCount - 1, 1) = cMonth.Offset(0, 1).Value
End With

I have saved a value of the planned month as PlanMonth and would like for
the combo box to default to that value when it's opened. What do I need to
do to get this to work?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default Setting default value for combo box

With Me.cboPlanMonth
.AddItem cMonth.Value
If cMonth.Value = PlanMonth Then
.ListIndex = .ListCount -1
End If
.List(.ListCount - 1, 1) = cMonth.Offset(0, 1).Value
End With


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Barb Reinhardt" wrote in message
...
I'm populating the values for a combo box using the following:

With Me.cboPlanMonth
.AddItem cMonth.Value
.List(.ListCount - 1, 1) = cMonth.Offset(0, 1).Value
End With

I have saved a value of the planned month as PlanMonth and would like for
the combo box to default to that value when it's opened. What do I need

to
do to get this to work?

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
setting default filter setting tpeter Charts and Charting in Excel 0 December 4th 09 02:50 PM
setting up drop down combo box with VBA windsurferLA Excel Programming 4 May 5th 05 11:10 PM
Setting default pivot table field setting to "sum" Mr. Moose Excel Discussion (Misc queries) 2 December 21st 04 04:43 PM
Setting the value of a cell from a combo box Nigel BEnnett Excel Programming 1 June 1st 04 07:36 PM
Setting default Tab Name Cameron[_2_] Excel Programming 3 July 31st 03 11:02 PM


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