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

I am trying to create a unique id number for each line in a spreadsheet by
combining an existing account number and an audit date.

I have been using the following code:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
DateValue(CMTAudit.AuditDateTxt.Value)

Unfortunately I keep getting the account number and the standard date format
combined. For Example from and account number of 123456 and 3/24/05 I get:

"1234563/24/05"

What I would like is:

"12345638435"

I know that I am overlooking something pretty simple but it eludes me.

WillRn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default DateValue Trouble

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Replace(DateValue(CMTAudit.AuditDateTxt.Value),"/","")


"WillRn" wrote:

I am trying to create a unique id number for each line in a spreadsheet by
combining an existing account number and an audit date.

I have been using the following code:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
DateValue(CMTAudit.AuditDateTxt.Value)

Unfortunately I keep getting the account number and the standard date format
combined. For Example from and account number of 123456 and 3/24/05 I get:

"1234563/24/05"

What I would like is:

"12345638435"

I know that I am overlooking something pretty simple but it eludes me.

WillRn

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default DateValue Trouble

Use the Format function to format the date to a number, e.g.:
FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Format(DateValue(CMTAudit.AuditDateTxt.Value),"### ##")


"WillRn" wrote:

I am trying to create a unique id number for each line in a spreadsheet by
combining an existing account number and an audit date.

I have been using the following code:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
DateValue(CMTAudit.AuditDateTxt.Value)

Unfortunately I keep getting the account number and the standard date format
combined. For Example from and account number of 123456 and 3/24/05 I get:

"1234563/24/05"

What I would like is:

"12345638435"

I know that I am overlooking something pretty simple but it eludes me.

WillRn

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default DateValue Trouble

Thanks for the help Charlie,

But I wanted the system date value number. i.e. - 3/24/05 = 38435

I finally stumbled on the answer using the "Format" function as follows:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Format(CMTAudit.AuditDateTxt.Value, vbGeneralDate)

Sometimes I actually find something useful in the VB Help files . . . : )

WillRN

"Charlie" wrote:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Replace(DateValue(CMTAudit.AuditDateTxt.Value),"/","")


"WillRn" wrote:

I am trying to create a unique id number for each line in a spreadsheet by
combining an existing account number and an audit date.

I have been using the following code:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
DateValue(CMTAudit.AuditDateTxt.Value)

Unfortunately I keep getting the account number and the standard date format
combined. For Example from and account number of 123456 and 3/24/05 I get:

"1234563/24/05"

What I would like is:

"12345638435"

I know that I am overlooking something pretty simple but it eludes me.

WillRn

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default DateValue Trouble

Thanks for the info,

For once I actually discovered the answer myself.

Now, if I could only answer my own VB questions the 3,537 times I have
problems life would be good! . . . : )

Thanks,

WillRn

"K Dales" wrote:

Use the Format function to format the date to a number, e.g.:
FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Format(DateValue(CMTAudit.AuditDateTxt.Value),"### ##")


"WillRn" wrote:

I am trying to create a unique id number for each line in a spreadsheet by
combining an existing account number and an audit date.

I have been using the following code:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
DateValue(CMTAudit.AuditDateTxt.Value)

Unfortunately I keep getting the account number and the standard date format
combined. For Example from and account number of 123456 and 3/24/05 I get:

"1234563/24/05"

What I would like is:

"12345638435"

I know that I am overlooking something pretty simple but it eludes me.

WillRn



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default DateValue Trouble

Yes, that's even better!

P.S. Those Help files do work sometimes

"WillRn" wrote:

Thanks for the help Charlie,

But I wanted the system date value number. i.e. - 3/24/05 = 38435

I finally stumbled on the answer using the "Format" function as follows:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Format(CMTAudit.AuditDateTxt.Value, vbGeneralDate)

Sometimes I actually find something useful in the VB Help files . . . : )

WillRN

"Charlie" wrote:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Replace(DateValue(CMTAudit.AuditDateTxt.Value),"/","")


"WillRn" wrote:

I am trying to create a unique id number for each line in a spreadsheet by
combining an existing account number and an audit date.

I have been using the following code:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
DateValue(CMTAudit.AuditDateTxt.Value)

Unfortunately I keep getting the account number and the standard date format
combined. For Example from and account number of 123456 and 3/24/05 I get:

"1234563/24/05"

What I would like is:

"12345638435"

I know that I am overlooking something pretty simple but it eludes me.

WillRn

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default DateValue Trouble

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Clng(CMTAudit.AuditDateTxt.Value)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"WillRn" wrote in message
...
Thanks for the help Charlie,

But I wanted the system date value number. i.e. - 3/24/05 = 38435

I finally stumbled on the answer using the "Format" function as follows:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Format(CMTAudit.AuditDateTxt.Value, vbGeneralDate)

Sometimes I actually find something useful in the VB Help files . . . : )

WillRN

"Charlie" wrote:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
Replace(DateValue(CMTAudit.AuditDateTxt.Value),"/","")


"WillRn" wrote:

I am trying to create a unique id number for each line in a

spreadsheet by
combining an existing account number and an audit date.

I have been using the following code:

FollowUpInitial.EventID.Value = CMTAudit.AcctNumberTxt.Value & _
DateValue(CMTAudit.AuditDateTxt.Value)

Unfortunately I keep getting the account number and the standard date

format
combined. For Example from and account number of 123456 and 3/24/05 I

get:

"1234563/24/05"

What I would like is:

"12345638435"

I know that I am overlooking something pretty simple but it eludes me.

WillRn



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
Help With DATEVALUE Dick Frederick Excel Worksheet Functions 3 January 28th 07 09:18 PM
Something other than DATEVALUE edwardpestian Excel Worksheet Functions 5 August 9th 06 04:59 AM
datevalue() tombogman Excel Worksheet Functions 6 April 26th 06 10:57 PM
=DATEVALUE JR Excel Worksheet Functions 5 January 31st 06 06:10 PM
datevalue RUanExcelnut Excel Worksheet Functions 2 January 12th 05 08:26 PM


All times are GMT +1. The time now is 03:59 PM.

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"