Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default How To Get A Date To Advance In A TextBox

Greetings,

I have a TextBox that needs to display in a date format and a
CommandButton that needs to advance this date by 1 day every time it
is clicked.

The first question is how to get TextBox1 to display a date format
(mmm/dd/yyyy)?

The second question is how to advance this date with a CommandButton
(the button is called NextDateButton)?

Any help would be appreciated.

TIA

-Minitman
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How To Get A Date To Advance In A TextBox


You have not said were the text box is on a sheet or a dilaog box


for a sheet

this gives todays date
Sheets(1).TextBox1.Text = Format(Now(), "dd/mm/yyyy")

this adds 1 to the date in the text box
Sheets(1).TextBox1.Text = Format(DateValue(Sheets(1). _
TextBox1.Text) + 1, "dd/mm/yyyy"

--
mudrake
-----------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...nfo&userid=247
View this thread: http://www.excelforum.com/showthread.php?threadid=27140

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default How To Get A Date To Advance In A TextBox - Solved

Sorry, this TextBox is on a UserForm.

I modified your code thus:

TextBox1.Text = Format(DateValue(TextBox1.Text) + 1, "mmm/dd/yyyy")

And placed it in the code of the "Next" button.

It works very well.

Thank you.

-Minitman


On Thu, 21 Oct 2004 20:58:55 -0500, mudraker
wrote:


You have not said were the text box is on a sheet or a dilaog box


for a sheet

this gives todays date
Sheets(1).TextBox1.Text = Format(Now(), "dd/mm/yyyy")

this adds 1 to the date in the text box
Sheets(1).TextBox1.Text = Format(DateValue(Sheets(1). _
TextBox1.Text) + 1, "dd/mm/yyyy")


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
How do I insert a date that is always 7 days in advance of today Waterhun Excel Discussion (Misc queries) 3 June 19th 08 08:12 PM
Textbox to show date K1KKKA Excel Discussion (Misc queries) 2 October 22nd 07 11:32 PM
how to creat a formula to advance date by one year Liz Lalman Excel Worksheet Functions 3 January 18th 07 08:46 PM
can excel flagup in advance of a date, say 6 weeks natty Excel Discussion (Misc queries) 2 July 12th 05 10:32 AM
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 01:56 AM.

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"