Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Steven Cheng
 
Posts: n/a
Default Date format on a drop down box

I have a dropdown box that is linked to a cell where a date is put that is
used for other things. The drop down box is filling itself from a range,
which contains a sequential list of dates. I have verified that the dates
are indeed dates and not text values. However, whenever I select a date
using the drop down list, the link cell reverts to a serial format. I have
tried to reformat the cell to be mm/dd/yyyy manually but without any success.

Should be a simple reason but I am stumped here.
  #2   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

You have to format the cell' where you select the date, too. Formatting the
data validation list range determines only, how are selections in drop-down
displayed. You can format the destination cell in same way, or differently,
as you like. It's mystery to me, why you didn't success with it - maybe you
try again.

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Steven Cheng" wrote in message
...
I have a dropdown box that is linked to a cell where a date is put that is
used for other things. The drop down box is filling itself from a range,
which contains a sequential list of dates. I have verified that the dates
are indeed dates and not text values. However, whenever I select a date
using the drop down list, the link cell reverts to a serial format. I

have
tried to reformat the cell to be mm/dd/yyyy manually but without any

success.

Should be a simple reason but I am stumped here.



  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Is this a dropdown from the Forms toolbar or a combobox from the control toolbox
toolbar?

When I tried a dropdown from the Forms toolbar, I saw the dates listed
nicely--both in the dropdown and when it was selected (in the dropdown).

But with the combobox from the control toolbox toolbar, the chosen value looked
like the date's serial value.

But I could format the value the way I wanted if I used code.

Go into design mode (an icon on that same control toolbox toolbar).
double click on your combobox.
paste this code in:

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

(I used combobox1. Change that if necessary.)

Steven Cheng wrote:

I have a dropdown box that is linked to a cell where a date is put that is
used for other things. The drop down box is filling itself from a range,
which contains a sequential list of dates. I have verified that the dates
are indeed dates and not text values. However, whenever I select a date
using the drop down list, the link cell reverts to a serial format. I have
tried to reformat the cell to be mm/dd/yyyy manually but without any success.

Should be a simple reason but I am stumped here.


--

Dave Peterson
  #4   Report Post  
Steven Cheng
 
Posts: n/a
Default

Dave;

It is a combobox from the control toolbox. I didn't use the forms one.

As for the combobox, I used the code and it works. It's just that I have a
vlookup function dependent up the value in the linked cell and it is giving
me a N/A error. The date list that is filling the range starts with a
beginning period start date which is entered in mm/dd/yyyy and there is a
formula to increase it one day. If I override the formula and put the dates
in manually, the combobox's linked cell formats the date correctly. But the
vlookup values are still returning an N/A error.

I have formated the date and tested to ensure that it is a number. Both
work out fine, however, the lingering problem is this list. I wonder if it
has something to do with the file itself. This file was originally a Lotus
file. Just speculating but could this be an issue? I have turned off the
translations but could there be something else....inquiring minds want to
know.

Steven

"Dave Peterson" wrote:

Is this a dropdown from the Forms toolbar or a combobox from the control toolbox
toolbar?

When I tried a dropdown from the Forms toolbar, I saw the dates listed
nicely--both in the dropdown and when it was selected (in the dropdown).

But with the combobox from the control toolbox toolbar, the chosen value looked
like the date's serial value.

But I could format the value the way I wanted if I used code.

Go into design mode (an icon on that same control toolbox toolbar).
double click on your combobox.
paste this code in:

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

(I used combobox1. Change that if necessary.)

Steven Cheng wrote:

I have a dropdown box that is linked to a cell where a date is put that is
used for other things. The drop down box is filling itself from a range,
which contains a sequential list of dates. I have verified that the dates
are indeed dates and not text values. However, whenever I select a date
using the drop down list, the link cell reverts to a serial format. I have
tried to reformat the cell to be mm/dd/yyyy manually but without any success.

Should be a simple reason but I am stumped here.


--

Dave Peterson

  #5   Report Post  
Steven Cheng
 
Posts: n/a
Default

Dave;

I found this on the knowledgebase. Would this explain why?

http://support.microsoft.com/default...b;en-us;170442

"Dave Peterson" wrote:

Is this a dropdown from the Forms toolbar or a combobox from the control toolbox
toolbar?

When I tried a dropdown from the Forms toolbar, I saw the dates listed
nicely--both in the dropdown and when it was selected (in the dropdown).

But with the combobox from the control toolbox toolbar, the chosen value looked
like the date's serial value.

But I could format the value the way I wanted if I used code.

Go into design mode (an icon on that same control toolbox toolbar).
double click on your combobox.
paste this code in:

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

(I used combobox1. Change that if necessary.)

Steven Cheng wrote:

I have a dropdown box that is linked to a cell where a date is put that is
used for other things. The drop down box is filling itself from a range,
which contains a sequential list of dates. I have verified that the dates
are indeed dates and not text values. However, whenever I select a date
using the drop down list, the link cell reverts to a serial format. I have
tried to reformat the cell to be mm/dd/yyyy manually but without any success.

Should be a simple reason but I am stumped here.


--

Dave Peterson



  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default

I don't know why your formula isn't incrementing the dates correctly.

You may want to post the formula.

If you format those date cells as General, do you see any decimals?

Do the same thing with the list of dates that you use for the input range.



Steven Cheng wrote:

Dave;

It is a combobox from the control toolbox. I didn't use the forms one.

As for the combobox, I used the code and it works. It's just that I have a
vlookup function dependent up the value in the linked cell and it is giving
me a N/A error. The date list that is filling the range starts with a
beginning period start date which is entered in mm/dd/yyyy and there is a
formula to increase it one day. If I override the formula and put the dates
in manually, the combobox's linked cell formats the date correctly. But the
vlookup values are still returning an N/A error.

I have formated the date and tested to ensure that it is a number. Both
work out fine, however, the lingering problem is this list. I wonder if it
has something to do with the file itself. This file was originally a Lotus
file. Just speculating but could this be an issue? I have turned off the
translations but could there be something else....inquiring minds want to
know.

Steven

"Dave Peterson" wrote:

Is this a dropdown from the Forms toolbar or a combobox from the control toolbox
toolbar?

When I tried a dropdown from the Forms toolbar, I saw the dates listed
nicely--both in the dropdown and when it was selected (in the dropdown).

But with the combobox from the control toolbox toolbar, the chosen value looked
like the date's serial value.

But I could format the value the way I wanted if I used code.

Go into design mode (an icon on that same control toolbox toolbar).
double click on your combobox.
paste this code in:

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

(I used combobox1. Change that if necessary.)

Steven Cheng wrote:

I have a dropdown box that is linked to a cell where a date is put that is
used for other things. The drop down box is filling itself from a range,
which contains a sequential list of dates. I have verified that the dates
are indeed dates and not text values. However, whenever I select a date
using the drop down list, the link cell reverts to a serial format. I have
tried to reformat the cell to be mm/dd/yyyy manually but without any success.

Should be a simple reason but I am stumped here.


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Dave Peterson
 
Posts: n/a
Default

It sure looks like it describes your original problem--not the =vlookup() one,
though.

Steven Cheng wrote:

Dave;

I found this on the knowledgebase. Would this explain why?

http://support.microsoft.com/default...b;en-us;170442

"Dave Peterson" wrote:

Is this a dropdown from the Forms toolbar or a combobox from the control toolbox
toolbar?

When I tried a dropdown from the Forms toolbar, I saw the dates listed
nicely--both in the dropdown and when it was selected (in the dropdown).

But with the combobox from the control toolbox toolbar, the chosen value looked
like the date's serial value.

But I could format the value the way I wanted if I used code.

Go into design mode (an icon on that same control toolbox toolbar).
double click on your combobox.
paste this code in:

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

(I used combobox1. Change that if necessary.)

Steven Cheng wrote:

I have a dropdown box that is linked to a cell where a date is put that is
used for other things. The drop down box is filling itself from a range,
which contains a sequential list of dates. I have verified that the dates
are indeed dates and not text values. However, whenever I select a date
using the drop down list, the link cell reverts to a serial format. I have
tried to reformat the cell to be mm/dd/yyyy manually but without any success.

Should be a simple reason but I am stumped here.


--

Dave Peterson


--

Dave Peterson
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
Format cells as date bay Excel Discussion (Misc queries) 3 January 26th 05 05:34 PM
USING THE DATE FORMAT IN EXCEL teach Excel Discussion (Misc queries) 3 December 14th 04 11:55 PM
Date format collapses diagram Richard H Excel Discussion (Misc queries) 3 December 14th 04 11:08 PM
problem with formatting cell to date format Del Excel Worksheet Functions 7 December 8th 04 05:14 PM
Problem with Date format from VBA code twig Excel Discussion (Misc queries) 3 December 7th 04 06:01 PM


All times are GMT +1. The time now is 11:21 PM.

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"