ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dates and Combobox problems (https://www.excelbanter.com/excel-programming/395602-dates-combobox-problems.html)

Graham F[_2_]

Dates and Combobox problems
 
I have a user form with a combobox that has a row source set to cells
formatted as dd-mmm-yy. My problem is that the combobox displays this as a
serial number and then writes the date to the worksheet as mm-dd-yy. The
regional settings are set to English.I guess this is basic, but it is giving
me real problems. Any help would be much appreciated. Many thanks Graham

joel

Dates and Combobox problems
 
When you put a date in a combox you need to convert it to a string. the can
be done with a format statement

string_date = format(mydate,"mm-dd-yy"). You want to write the actual
serial number date to the worksheet and make sure the cells are format as
date so you don't get a serial number displayed on the worksheet.

"Graham F" wrote:

I have a user form with a combobox that has a row source set to cells
formatted as dd-mmm-yy. My problem is that the combobox displays this as a
serial number and then writes the date to the worksheet as mm-dd-yy. The
regional settings are set to English.I guess this is basic, but it is giving
me real problems. Any help would be much appreciated. Many thanks Graham


Graham F[_2_]

Dates and Combobox problems
 
Many thanks Joel, you solved the problem!

"Joel" wrote:

When you put a date in a combox you need to convert it to a string. the can
be done with a format statement

string_date = format(mydate,"mm-dd-yy"). You want to write the actual
serial number date to the worksheet and make sure the cells are format as
date so you don't get a serial number displayed on the worksheet.

"Graham F" wrote:

I have a user form with a combobox that has a row source set to cells
formatted as dd-mmm-yy. My problem is that the combobox displays this as a
serial number and then writes the date to the worksheet as mm-dd-yy. The
regional settings are set to English.I guess this is basic, but it is giving
me real problems. Any help would be much appreciated. Many thanks Graham



All times are GMT +1. The time now is 07:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com