Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default increment date code

I have a text box on a user form into which a date code must be entered
Instead of the user manually entering the code I would like the numbe
to be autogenerated.

For example, when the user form opens the automated number shoul
appear in the text box. The number will be saved when the user enter
OK and the form contents are saved to the excel sheet.

The date code format is as follows.

YYMMDD-## (date-record number).

The code should get today's date and increment the ## (record number
with each form save. For example:

040517-01 which will increment to 040517-02 which will increment t
040517-3 and so on. The first six digits are the actual date while th
second two identify a particular record.

Thank you for your consideration

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default increment date code

Something like

Textbox1.Text=Format(Date,"yymmdd") & "-" &
Format(Range("IV1").Value,"00")

in the userform activate, and

Range("IV1").Value =Range("IV1").Value +1 m

in the save code.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"prodsched " wrote in message
...
I have a text box on a user form into which a date code must be entered.
Instead of the user manually entering the code I would like the number
to be autogenerated.

For example, when the user form opens the automated number should
appear in the text box. The number will be saved when the user enters
OK and the form contents are saved to the excel sheet.

The date code format is as follows.

YYMMDD-## (date-record number).

The code should get today's date and increment the ## (record number)
with each form save. For example:

040517-01 which will increment to 040517-02 which will increment to
040517-3 and so on. The first six digits are the actual date while the
second two identify a particular record.

Thank you for your consideration.


---
Message posted from http://www.ExcelForum.com/



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
Date/time increment specifier adimar Excel Worksheet Functions 4 February 7th 08 12:38 AM
Exel increment date problem wrt todays date. [email protected] Excel Worksheet Functions 1 November 11th 07 06:58 PM
How to increment the date Tom Excel Discussion (Misc queries) 13 January 1st 07 07:26 AM
Time and Date increment La La Lara Excel Discussion (Misc queries) 0 January 18th 05 09:59 AM
How do I increment a date by a certain number of weeks? LatestCraze Excel Worksheet Functions 2 December 9th 04 09:05 PM


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