#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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
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
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM
Access from add_in userform to main template userform.... Ajit Excel Programming 1 November 18th 04 05:15 PM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM


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