Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform
I have a textbox on a userform which reads a date from a cell in spreadsheet.
Problem I am getting is each time I open the form the format of the date changes in both the the textbox and cell. ie if cell is format dd/mm/yyyy the Textbox shows mm/dd/yyyy. When I open the form again, it is the oposite of the first result? I have tried using Format eg Textbox1.Text = Format(Cells(1,2).value, "dd/mm/yyyy") but the date still shows different format for Textbox & Cell! Can anyone explain why this should happen & how I show to the Texbox the cell value & format without changing it please?? Many thanks -- JB |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform
Don't link the checkbox to the cell. Load the checkbox with code.
always convert a string date with Cdate - it will pay attention to your local settings. -- Regards, Tom Ogilvy "johnboy" wrote: I have a textbox on a userform which reads a date from a cell in spreadsheet. Problem I am getting is each time I open the form the format of the date changes in both the the textbox and cell. ie if cell is format dd/mm/yyyy the Textbox shows mm/dd/yyyy. When I open the form again, it is the oposite of the first result? I have tried using Format eg Textbox1.Text = Format(Cells(1,2).value, "dd/mm/yyyy") but the date still shows different format for Textbox & Cell! Can anyone explain why this should happen & how I show to the Texbox the cell value & format without changing it please?? Many thanks -- JB |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform
and it was that simple! thanks very much Tom - really appreciated!
-- JB "Tom Ogilvy" wrote: Don't link the checkbox to the cell. Load the checkbox with code. always convert a string date with Cdate - it will pay attention to your local settings. -- Regards, Tom Ogilvy "johnboy" wrote: I have a textbox on a userform which reads a date from a cell in spreadsheet. Problem I am getting is each time I open the form the format of the date changes in both the the textbox and cell. ie if cell is format dd/mm/yyyy the Textbox shows mm/dd/yyyy. When I open the form again, it is the oposite of the first result? I have tried using Format eg Textbox1.Text = Format(Cells(1,2).value, "dd/mm/yyyy") but the date still shows different format for Textbox & Cell! Can anyone explain why this should happen & how I show to the Texbox the cell value & format without changing it please?? Many thanks -- JB |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform to enter values and shown in same userform in list | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Access from add_in userform to main template userform.... | Excel Programming | |||
Linking userform to userform in Excel 2003 | Excel Programming |