Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Textbox date

I am using a commandbutton to enter the current date in a textbox which is
then used to populate a cell.

1. If I use TextBox1.Value = Date, the format in the textbox is
mm/dd/yyyy but appears as a date formatted dd/mm/yyyy in the cell
2. If I use TextBox1.Value = Format(Date, "dd/mm/yyyy"), the format in
both textbox and cell is dd/mm/yyyy

I need to compare another cell to the current date cell to see if the other
cell is before today (cond format). In case 1 this is fine, but in case 2
all dates appear to be before today.

How can I get the currect date to appear correctly in both locations and
still be able to compare it as a date?

--
Ian
--


  #2   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Textbox date

The command button and textbox are both on a userform, in case that's
relevant.

--
Ian
--
"Ian" wrote in message
...
I am using a commandbutton to enter the current date in a textbox which is
then used to populate a cell.

1. If I use TextBox1.Value = Date, the format in the textbox is
mm/dd/yyyy but appears as a date formatted dd/mm/yyyy in the cell
2. If I use TextBox1.Value = Format(Date, "dd/mm/yyyy"), the format in
both textbox and cell is dd/mm/yyyy

I need to compare another cell to the current date cell to see if the
other cell is before today (cond format). In case 1 this is fine, but in
case 2 all dates appear to be before today.

How can I get the currect date to appear correctly in both locations and
still be able to compare it as a date?

--
Ian
--




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
Textbox to show date K1KKKA Excel Discussion (Misc queries) 2 October 22nd 07 11:32 PM
Date format textbox George Excel Discussion (Misc queries) 2 September 20th 06 09:09 PM
Entering a date in a textbox johncassell[_7_] Excel Programming 3 July 25th 05 02:56 PM
Date format in textbox Bruce Excel Programming 1 April 15th 04 04:28 PM
converting date from a textbox to a date format neowok[_17_] Excel Programming 5 February 23rd 04 01:40 PM


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