Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Help with VBA (or VB) DateAdd, WORDAY functions, date format

A custom dialog box (input form) I created for Excel has 2 date fields--one
90 days later than the other. The first field defaults to today:

datInitDate.Value = Date$
(displays as 01-06-2005)

The second defaults to 90 days later than whatever winds up in that field:

datComplDate.Value = DateAdd("d", 90, datInitDate.Value)
(displays as 4/6/2005)


How do I make these two dates have the same format?

Alternatively, I also added the Analysis Toolpack, put a reference to it in
my VBA project and tried using these--which fail as "out of range" (both are
empty):

TODAY() and (or TODAY, with no parentheses)
WORKDAY(TODAY(),90)

This fails and I cannot find any help (online or in my Object Browser for
all libraries) to see a working example.

Do TODAY/WORKDAY require DIM statements? (Are these arrays?)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help with VBA (or VB) DateAdd, WORDAY functions, date format


datInitDate.Value = Format(Date,"mm-dd-yyyy")

datComplDate.Value = Format(Date + 90,"mm-dd-yyyy")

--

HTH

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


"Kind writer/user/programmer" wrote in
message ...
A custom dialog box (input form) I created for Excel has 2 date

fields--one
90 days later than the other. The first field defaults to today:

datInitDate.Value = Date$
(displays as 01-06-2005)

The second defaults to 90 days later than whatever winds up in that

field:

datComplDate.Value = DateAdd("d", 90, datInitDate.Value)
(displays as 4/6/2005)


How do I make these two dates have the same format?

Alternatively, I also added the Analysis Toolpack, put a reference to it

in
my VBA project and tried using these--which fail as "out of range" (both

are
empty):

TODAY() and (or TODAY, with no parentheses)
WORKDAY(TODAY(),90)

This fails and I cannot find any help (online or in my Object Browser for
all libraries) to see a working example.

Do TODAY/WORKDAY require DIM statements? (Are these arrays?)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Help with VBA (or VB) DateAdd, WORDAY functions, date format

Thanks Bob! That works great! The VBA Help for FormatDate, and Format were
not so easy to decipher as your cogent examples!

"Bob Phillips" wrote:


datInitDate.Value = Format(Date,"mm-dd-yyyy")

datComplDate.Value = Format(Date + 90,"mm-dd-yyyy")

--

HTH

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


"Kind writer/user/programmer" wrote in
message ...
A custom dialog box (input form) I created for Excel has 2 date

fields--one
90 days later than the other. The first field defaults to today:

datInitDate.Value = Date$
(displays as 01-06-2005)

The second defaults to 90 days later than whatever winds up in that

field:

datComplDate.Value = DateAdd("d", 90, datInitDate.Value)
(displays as 4/6/2005)


How do I make these two dates have the same format?

Alternatively, I also added the Analysis Toolpack, put a reference to it

in
my VBA project and tried using these--which fail as "out of range" (both

are
empty):

TODAY() and (or TODAY, with no parentheses)
WORKDAY(TODAY(),90)

This fails and I cannot find any help (online or in my Object Browser for
all libraries) to see a working example.

Do TODAY/WORKDAY require DIM statements? (Are these arrays?)




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help with VBA (or VB) DateAdd, WORDAY functions, date format

Pleasure Jenelle. Thanks for the feedback.

--

HTH

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


"jenelle" wrote in message
...
Thanks Bob! That works great! The VBA Help for FormatDate, and Format were
not so easy to decipher as your cogent examples!

"Bob Phillips" wrote:


datInitDate.Value = Format(Date,"mm-dd-yyyy")

datComplDate.Value = Format(Date + 90,"mm-dd-yyyy")

--

HTH

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


"Kind writer/user/programmer"

wrote in
message ...
A custom dialog box (input form) I created for Excel has 2 date

fields--one
90 days later than the other. The first field defaults to today:

datInitDate.Value = Date$
(displays as 01-06-2005)

The second defaults to 90 days later than whatever winds up in that

field:

datComplDate.Value = DateAdd("d", 90, datInitDate.Value)
(displays as 4/6/2005)


How do I make these two dates have the same format?

Alternatively, I also added the Analysis Toolpack, put a reference to

it
in
my VBA project and tried using these--which fail as "out of range"

(both
are
empty):

TODAY() and (or TODAY, with no parentheses)
WORKDAY(TODAY(),90)

This fails and I cannot find any help (online or in my Object Browser

for
all libraries) to see a working example.

Do TODAY/WORKDAY require DIM statements? (Are these arrays?)






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Help with VBA date format

User error discovered:

The Format(....+90) worked on my machine (because I have VB); however, the
compiled project fails on users machines who have Office 2002 (but not VB)
installed.

Ouch.

"Bob Phillips" wrote:

Pleasure Jenelle. Thanks for the feedback.

--

HTH

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


"jenelle" wrote in message
...
Thanks Bob! That works great! The VBA Help for FormatDate, and Format were
not so easy to decipher as your cogent examples!

"Bob Phillips" wrote:


datInitDate.Value = Format(Date,"mm-dd-yyyy")

datComplDate.Value = Format(Date + 90,"mm-dd-yyyy")

--

HTH

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


"Kind writer/user/programmer"

wrote in
message ...
A custom dialog box (input form) I created for Excel has 2 date
fields--one
90 days later than the other. The first field defaults to today:

datInitDate.Value = Date$
(displays as 01-06-2005)

The second defaults to 90 days later than whatever winds up in that
field:

datComplDate.Value = DateAdd("d", 90, datInitDate.Value)
(displays as 4/6/2005)


How do I make these two dates have the same format?

Alternatively, I also added the Analysis Toolpack, put a reference to

it
in
my VBA project and tried using these--which fail as "out of range"

(both
are
empty):

TODAY() and (or TODAY, with no parentheses)
WORKDAY(TODAY(),90)

This fails and I cannot find any help (online or in my Object Browser

for
all libraries) to see a working example.

Do TODAY/WORKDAY require DIM statements? (Are these arrays?)








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help with VBA date format

Doesn't need VB. What error is it?

--

HTH

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


"jenelle" wrote in message
...
User error discovered:

The Format(....+90) worked on my machine (because I have VB); however, the
compiled project fails on users machines who have Office 2002 (but not VB)
installed.

Ouch.

"Bob Phillips" wrote:

Pleasure Jenelle. Thanks for the feedback.

--

HTH

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


"jenelle" wrote in message
...
Thanks Bob! That works great! The VBA Help for FormatDate, and Format

were
not so easy to decipher as your cogent examples!

"Bob Phillips" wrote:


datInitDate.Value = Format(Date,"mm-dd-yyyy")

datComplDate.Value = Format(Date + 90,"mm-dd-yyyy")

--

HTH

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


"Kind writer/user/programmer"

wrote in
message ...
A custom dialog box (input form) I created for Excel has 2 date
fields--one
90 days later than the other. The first field defaults to today:

datInitDate.Value = Date$
(displays as 01-06-2005)

The second defaults to 90 days later than whatever winds up in

that
field:

datComplDate.Value = DateAdd("d", 90,

datInitDate.Value)
(displays as 4/6/2005)


How do I make these two dates have the same format?

Alternatively, I also added the Analysis Toolpack, put a reference

to
it
in
my VBA project and tried using these--which fail as "out of range"

(both
are
empty):

TODAY() and (or TODAY, with no parentheses)
WORKDAY(TODAY(),90)

This fails and I cannot find any help (online or in my Object

Browser
for
all libraries) to see a working example.

Do TODAY/WORKDAY require DIM statements? (Are these arrays?)








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
Arithmatic functions with date format...angry results chris23892 via OfficeKB.com Excel Worksheet Functions 7 January 8th 09 07:38 PM
dateadd The BriGuy[_2_] Excel Discussion (Misc queries) 1 March 29th 07 06:51 PM
The Worday Function Kevin Excel Worksheet Functions 5 May 10th 05 03:45 AM
DateAdd Michael Wise[_7_] Excel Programming 1 August 27th 04 07:40 PM
DateAdd function Bill[_19_] Excel Programming 2 November 12th 03 07:07 PM


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