#1   Report Post  
Posted to microsoft.public.excel.misc
DCSwearingen
 
Posts: n/a
Default Combo Box Help


I have put a combo box from the Control Toolbar onto my spreadsheet. I
have a named range that corresponds to our company's fiscal periods
(all month ending dates, period 1 ends July 31, period 2 ends Aug 31,
etc.)

I have the named range (fPeriods) on a different spreadsheet (within
the same workbook) with the month ending dates.

The copbo box displays the list of month ending dates on the drop down,
but when a date is selected the combo box displays the numeric version
of that date.

e.g. 31-Jul-06 is the first item on the drop down list, but when it is
selected the combo control now displays --38929--

What do I need to do to have the combo box control to display in the
same format as in my list, once the list item has been selected?


--
DCSwearingen

Getting old, but love computers.
------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=547249

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Combo Box Help

One way is to populate the combobox through code.

I chose to use the workbook_open event (under the ThisWorkbook module):

Option Explicit
Private Sub Workbook_Open()
Dim myCell As Range
For Each myCell In Worksheets("Sheet2").Range("fPeriods")
Worksheets("sheet1").ComboBox1.AddItem myCell.Text
Next myCell
End Sub

(And remove the listfillrange address if you used it.)

Another way is to modify the format after the change:

Option Explicit
Dim BlkProc As Boolean
Private Sub ComboBox1_Change()
If BlkProc = True Then Exit Sub
BlkProc = True
Me.ComboBox1.Value = Format(Me.ComboBox1.Value, "mm/dd/yyyy")
BlkProc = False
End Sub

Add the listfillrange address back in this case.

DCSwearingen wrote:

I have put a combo box from the Control Toolbar onto my spreadsheet. I
have a named range that corresponds to our company's fiscal periods
(all month ending dates, period 1 ends July 31, period 2 ends Aug 31,
etc.)

I have the named range (fPeriods) on a different spreadsheet (within
the same workbook) with the month ending dates.

The copbo box displays the list of month ending dates on the drop down,
but when a date is selected the combo box displays the numeric version
of that date.

e.g. 31-Jul-06 is the first item on the drop down list, but when it is
selected the combo control now displays --38929--

What do I need to do to have the combo box control to display in the
same format as in my list, once the list item has been selected?

--
DCSwearingen

Getting old, but love computers.
------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=547249


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
JimMay
 
Posts: n/a
Default Combo Box Help

In the Combobox_Change
event code, put code like this:
ComboBox1.Value = Format(ComboBox1.Value, "mm/dd/yyyy")

"DCSwearingen"
wrote in
message news:DCSwearingen.28oycb_1149111301.6721@excelforu m-nospam.com:

I have put a combo box from the Control Toolbar onto my spreadsheet. I
have a named range that corresponds to our company's fiscal periods
(all month ending dates, period 1 ends July 31, period 2 ends Aug 31,
etc.)

I have the named range (fPeriods) on a different spreadsheet (within
the same workbook) with the month ending dates.

The copbo box displays the list of month ending dates on the drop down,
but when a date is selected the combo box displays the numeric version
of that date.

e.g. 31-Jul-06 is the first item on the drop down list, but when it is
selected the combo control now displays --38929--

What do I need to do to have the combo box control to display in the
same format as in my list, once the list item has been selected?


--
DCSwearingen

Getting old, but love computers.
------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=547249


  #4   Report Post  
Posted to microsoft.public.excel.misc
DCSwearingen
 
Posts: n/a
Default Combo Box Help


I really apprecitate the solutions presented.
Multiple solutions give much food for thought!!

Thanks again!


--
DCSwearingen

Getting old, but love computers.
------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=547249

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
Getting A Value from a Combo Box to a Cell?? RP1507 Excel Discussion (Misc queries) 1 July 13th 05 03:14 PM
Nesting Combo Boxes /Returning an Array ELMONDO SNITHER Excel Discussion (Misc queries) 1 June 30th 05 01:15 AM
Dynamic Combo Box benjarfer Excel Worksheet Functions 2 April 8th 05 02:17 PM
connecting combo boxes to yield data in another cell. TxN8tv Excel Discussion (Misc queries) 0 March 14th 05 04:07 PM
dynamic combo boxes tjb Excel Worksheet Functions 2 January 25th 05 07:33 PM


All times are GMT +1. The time now is 12:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"