Hello newsgroup,

I need a little gadget that will show me the serial number for a date I
enter. I have come up with the code below, but I can not get it to show the
serial number that the computer uses for the input date. The date keeps
getting converted to the systems (short) date format. In Excel, I can do it
by entering a date in a cell that is not date-formatted, but I need a
quicker way, to fire from my desktop. Here's the basic code I'm
experimenting with:

===============================================
Dim time1, time2

result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
"Serial number for date", Date, 100, 100)

time1 = FormatDateTime(result, 1)
time2 = result

Response = MsgBox (time2, vbokonly, time1)
================================================

A related problem: I wanted to concatenate a string for the messagebox that
shows the result, but I keep coming up with errors that I think say that I
cannot use text together wit a set variable or a function. I can do this in
Excel VBA without any problem, so I suppose there must be a way. Here's the
gist of what I tried (with the above code):

Response = MsgBox ("The serial number for " + time1 + " is " + time2 + ".",
vbokonly, "Serial number for date")

I know I should have taken the course, but please help me out.


Have a nice day,


--
Eric van Uden
at the foot of the 'bridge too far'

Re: Show serial for date in messagebox by Robert

Robert
Mon Jul 07 19:54:53 CDT 2003

tell me if this does the trick:


Dim time1, time2

result = InputBox("Type a date in the dd-mm-jjjj format and click
OK","Serial number for date", Date, 100, 100)

time1 = FormatDateTime(result, 1)
time2 = result

oYear= DatePart ("yyyy", time2)
oMonth= DatePart("m", time2)
oday= DatePart("d", time2)

oNewDate= right("0" & oDay, 2) & "/" & right("0" & oMonth, 2) & "/" & oYear


Response = MsgBox (oNewDate, vbokonly, time1)

--
My E-mail address is rcohen@yourfears.bbhtx.org. If you
need to e-mail me off list just get rid of "your fears" and
drop me a line.


"Eric van Uden" <ericvanuden@supermail.nl> wrote in message
news:O1lZnVORDHA.2148@TK2MSFTNGP10.phx.gbl...
> Hello newsgroup,
>
> I need a little gadget that will show me the serial number for a date I
> enter. I have come up with the code below, but I can not get it to show
the
> serial number that the computer uses for the input date. The date keeps
> getting converted to the systems (short) date format. In Excel, I can do
it
> by entering a date in a cell that is not date-formatted, but I need a
> quicker way, to fire from my desktop. Here's the basic code I'm
> experimenting with:
>
> ===============================================
> Dim time1, time2
>
> result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
> "Serial number for date", Date, 100, 100)
>
> time1 = FormatDateTime(result, 1)
> time2 = result
>
> Response = MsgBox (time2, vbokonly, time1)
> ================================================
>
> A related problem: I wanted to concatenate a string for the messagebox
that
> shows the result, but I keep coming up with errors that I think say that I
> cannot use text together wit a set variable or a function. I can do this
in
> Excel VBA without any problem, so I suppose there must be a way. Here's
the
> gist of what I tried (with the above code):
>
> Response = MsgBox ("The serial number for " + time1 + " is " + time2 +
".",
> vbokonly, "Serial number for date")
>
> I know I should have taken the course, but please help me out.
>
>
> Have a nice day,
>
>
> --
> Eric van Uden
> at the foot of the 'bridge too far'
>
>



Re: Show serial for date in messagebox by Michael

Michael
Mon Jul 07 20:50:36 CDT 2003


"Eric van Uden" <ericvanuden@supermail.nl> wrote in message news:O1lZnVORDHA.2148@TK2MSFTNGP10.phx.gbl...
: Hello newsgroup,
:
: I need a little gadget that will show me the serial number for a date I
: enter. I have come up with the code below, but I can not get it to show the
: serial number that the computer uses for the input date. The date keeps
: getting converted to the systems (short) date format. In Excel, I can do it
: by entering a date in a cell that is not date-formatted, but I need a
: quicker way, to fire from my desktop. Here's the basic code I'm
: experimenting with:
:
: ===============================================
: Dim time1, time2
:
: result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
: "Serial number for date", Date, 100, 100)
:
: time1 = FormatDateTime(result, 1)
: time2 = result
:
: Response = MsgBox (time2, vbokonly, time1)
: ================================================
:
: A related problem: I wanted to concatenate a string for the messagebox that
: shows the result, but I keep coming up with errors that I think say that I
: cannot use text together wit a set variable or a function. I can do this in
: Excel VBA without any problem, so I suppose there must be a way. Here's the
: gist of what I tried (with the above code):
:
: Response = MsgBox ("The serial number for " + time1 + " is " + time2 + ".",
: vbokonly, "Serial number for date")
:
: I know I should have taken the course, but please help me out.
:
:
: Have a nice day,
:
:
: --
: Eric van Uden
: at the foot of the 'bridge too far'


msgbox date() & vbnewline & clng(date())



Re: Show serial for date in messagebox by Eric

Eric
Tue Jul 08 09:11:59 CDT 2003

Hello Robert,

Thanks for your input.

I'm afraid this doesn't help though. Your code gives me 8/7/2003 for
8-7-2003. But I already know the date. What I was looking for is the serial
number of the date. januari 1, 1900 is 1; januari 2, 1900 is 2 and so on.
"july 8 2003 is 22984" is the answer I want to pull from my script when I
enter (in accordance with system set time format) 8-7-2003.

Sorry if I failed to bring that across, and thanks again for your effort.

Have a beautiful day,


--
Eric van Uden
at the foot of the 'bridge too far'
"Robert Cohen" <jerrygarcia@gratefuldead.com> schreef in bericht
news:uGfYfvORDHA.1988@TK2MSFTNGP12.phx.gbl...
> tell me if this does the trick:
>
>
> Dim time1, time2
>
> result = InputBox("Type a date in the dd-mm-jjjj format and click
> OK","Serial number for date", Date, 100, 100)
>
> time1 = FormatDateTime(result, 1)
> time2 = result
>
> oYear= DatePart ("yyyy", time2)
> oMonth= DatePart("m", time2)
> oday= DatePart("d", time2)
>
> oNewDate= right("0" & oDay, 2) & "/" & right("0" & oMonth, 2) & "/" &
oYear
>
>
> Response = MsgBox (oNewDate, vbokonly, time1)
>
> --
> My E-mail address is rcohen@yourfears.bbhtx.org. If you
> need to e-mail me off list just get rid of "your fears" and
> drop me a line.
>
>
> "Eric van Uden" <ericvanuden@supermail.nl> wrote in message
> news:O1lZnVORDHA.2148@TK2MSFTNGP10.phx.gbl...
> > Hello newsgroup,
> >
> > I need a little gadget that will show me the serial number for a date I
> > enter. I have come up with the code below, but I can not get it to show
> the
> > serial number that the computer uses for the input date. The date keeps
> > getting converted to the systems (short) date format. In Excel, I can do
> it
> > by entering a date in a cell that is not date-formatted, but I need a
> > quicker way, to fire from my desktop. Here's the basic code I'm
> > experimenting with:
> >
> > ===============================================
> > Dim time1, time2
> >
> > result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
> > "Serial number for date", Date, 100, 100)
> >
> > time1 = FormatDateTime(result, 1)
> > time2 = result
> >
> > Response = MsgBox (time2, vbokonly, time1)
> > ================================================
> >
> > A related problem: I wanted to concatenate a string for the messagebox
> that
> > shows the result, but I keep coming up with errors that I think say that
I
> > cannot use text together wit a set variable or a function. I can do this
> in
> > Excel VBA without any problem, so I suppose there must be a way. Here's
> the
> > gist of what I tried (with the above code):
> >
> > Response = MsgBox ("The serial number for " + time1 + " is " + time2 +
> ".",
> > vbokonly, "Serial number for date")
> >
> > I know I should have taken the course, but please help me out.
> >
> >
> > Have a nice day,
> >
> >
> > --
> > Eric van Uden
> > at the foot of the 'bridge too far'
> >
> >
>
>



Re: Show serial for date in messagebox by Robert

Robert
Tue Jul 08 09:30:44 CDT 2003

have you tried the other users post.

msgbox date() & vbnewline & clng(date())

although that give 37810 instead of 22984

although if you multiple 103 years x 365 plus the days in this year, you
will get the 37810 not the 22984. So I think the 37810 is the correct
number

--
Sorry, I am no longer including my e-mail address as I am getting to much
spam. I really have no desire to enlarge "it" by three inches, that is even
if I get e-mailed 10 times a day from different e-mail addresses so I can't
block it.
Besides I finally came to believe what others have said, if you have a
question, you should ask the group as others might benefit from it. Anyone
on the group who I converse with off topic or on the side, can easily find
my e-mail address.
"Eric van Uden" <ericvanuden@supermail.nl> wrote in message
news:#T4AcrVRDHA.212@TK2MSFTNGP10.phx.gbl...
> Hello Robert,
>
> Thanks for your input.
>
> I'm afraid this doesn't help though. Your code gives me 8/7/2003 for
> 8-7-2003. But I already know the date. What I was looking for is the
serial
> number of the date. januari 1, 1900 is 1; januari 2, 1900 is 2 and so on.
> "july 8 2003 is 22984" is the answer I want to pull from my script when I
> enter (in accordance with system set time format) 8-7-2003.
>
> Sorry if I failed to bring that across, and thanks again for your effort.
>
> Have a beautiful day,
>
>
> --
> Eric van Uden
> at the foot of the 'bridge too far'
> "Robert Cohen" <jerrygarcia@gratefuldead.com> schreef in bericht
> news:uGfYfvORDHA.1988@TK2MSFTNGP12.phx.gbl...
> > tell me if this does the trick:
> >
> >
> > Dim time1, time2
> >
> > result = InputBox("Type a date in the dd-mm-jjjj format and click
> > OK","Serial number for date", Date, 100, 100)
> >
> > time1 = FormatDateTime(result, 1)
> > time2 = result
> >
> > oYear= DatePart ("yyyy", time2)
> > oMonth= DatePart("m", time2)
> > oday= DatePart("d", time2)
> >
> > oNewDate= right("0" & oDay, 2) & "/" & right("0" & oMonth, 2) & "/" &
> oYear
> >
> >
> > Response = MsgBox (oNewDate, vbokonly, time1)
> >
> > --
> > My E-mail address is rcohen@yourfears.bbhtx.org. If you
> > need to e-mail me off list just get rid of "your fears" and
> > drop me a line.
> >
> >
> > "Eric van Uden" <ericvanuden@supermail.nl> wrote in message
> > news:O1lZnVORDHA.2148@TK2MSFTNGP10.phx.gbl...
> > > Hello newsgroup,
> > >
> > > I need a little gadget that will show me the serial number for a date
I
> > > enter. I have come up with the code below, but I can not get it to
show
> > the
> > > serial number that the computer uses for the input date. The date
keeps
> > > getting converted to the systems (short) date format. In Excel, I can
do
> > it
> > > by entering a date in a cell that is not date-formatted, but I need a
> > > quicker way, to fire from my desktop. Here's the basic code I'm
> > > experimenting with:
> > >
> > > ===============================================
> > > Dim time1, time2
> > >
> > > result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
> > > "Serial number for date", Date, 100, 100)
> > >
> > > time1 = FormatDateTime(result, 1)
> > > time2 = result
> > >
> > > Response = MsgBox (time2, vbokonly, time1)
> > > ================================================
> > >
> > > A related problem: I wanted to concatenate a string for the messagebox
> > that
> > > shows the result, but I keep coming up with errors that I think say
that
> I
> > > cannot use text together wit a set variable or a function. I can do
this
> > in
> > > Excel VBA without any problem, so I suppose there must be a way.
Here's
> > the
> > > gist of what I tried (with the above code):
> > >
> > > Response = MsgBox ("The serial number for " + time1 + " is " + time2 +
> > ".",
> > > vbokonly, "Serial number for date")
> > >
> > > I know I should have taken the course, but please help me out.
> > >
> > >
> > > Have a nice day,
> > >
> > >
> > > --
> > > Eric van Uden
> > > at the foot of the 'bridge too far'
> > >
> > >
> >
> >
>
>



Re: Show serial for date in messagebox by Robert

Robert
Tue Jul 08 10:33:40 CDT 2003

okay, I got it. This works

Dim time1, time2

result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
"Serial number for date", Date, 100, 100)

MyLong = Cdate(result)
MyLong1 = clng(mylong)

time1 = FormatDateTime(result, 1)

Response = MsgBox (MyLong1, vbokonly, time1)

--

"Eric van Uden" <ericvanuden@supermail.nl> wrote in message
news:eowmdyVRDHA.3880@tk2msftngp13.phx.gbl...
> Hello Michael,
>
> Your answer is great if I only need to know the value for today.
> But the purpose of the inputbox was to allow any date to be entered.
> clng, cdate, ... doesn't work.
>
> Thank for your suggestion, though.
>
> In the mean time I came up with a solution:
>
> =========================================================
> Dim time1, time2
>
> result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
> "Serial number
>
> for date", Date, 100, 100)
>
> time1 = FormatDateTime(result, 1)
> time2 = cdate(result) - cdate(0)
>
> Response = MsgBox (time2, vbokonly, time1)
> ============================================================
>
> This still leaves me with the concatenation thing. I cannot find a way to
> get a string of text and the values for time1 and time2 into the
messagebox
> as a single sentence. One line or more lines isn't the big thing, but
> pasting the stuff together in something like this way:
>
> MsgBox ("The serial for " + time1 + " is " + time2, vbokonly, "Serial for
> date")
>
> Have a splendid day,
>
>
> --
> Eric van Uden
> at the foot of the 'bridge too far'
>
> "Michael Dunn" <m_odunn@yahoo.com> schreef in bericht
> news:uUHx$MPRDHA.1804@TK2MSFTNGP11.phx.gbl...
> >
> > "Eric van Uden" <ericvanuden@supermail.nl> wrote in message
> news:O1lZnVORDHA.2148@TK2MSFTNGP10.phx.gbl...
> > : Hello newsgroup,
> > :
> > : I need a little gadget that will show me the serial number for a date
I
> > : enter. I have come up with the code below, but I can not get it to
show
> the
> > : serial number that the computer uses for the input date. The date
keeps
> > : getting converted to the systems (short) date format. In Excel, I can
do
> it
> > : by entering a date in a cell that is not date-formatted, but I need a
> > : quicker way, to fire from my desktop. Here's the basic code I'm
> > : experimenting with:
> > :
> > : ===============================================
> > : Dim time1, time2
> > :
> > : result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
> > : "Serial number for date", Date, 100, 100)
> > :
> > : time1 = FormatDateTime(result, 1)
> > : time2 = result
> > :
> > : Response = MsgBox (time2, vbokonly, time1)
> > : ================================================
> > :
> > : A related problem: I wanted to concatenate a string for the messagebox
> that
> > : shows the result, but I keep coming up with errors that I think say
that
> I
> > : cannot use text together wit a set variable or a function. I can do
this
> in
> > : Excel VBA without any problem, so I suppose there must be a way.
Here's
> the
> > : gist of what I tried (with the above code):
> > :
> > : Response = MsgBox ("The serial number for " + time1 + " is " + time2 +
> ".",
> > : vbokonly, "Serial number for date")
> > :
> > : I know I should have taken the course, but please help me out.
> > :
> > :
> > : Have a nice day,
> > :
> > :
> > : --
> > : Eric van Uden
> > : at the foot of the 'bridge too far'
> >
> >
> > msgbox date() & vbnewline & clng(date())
> >
> >
>
>



Re: Show serial for date in messagebox by Eric

Eric
Tue Jul 08 15:19:05 CDT 2003

Hi Robert,

You cracked it!

The code I came up with and posted back was OK in representing the date
serial, but didn't allow for the composite sentence I was looking for. The
formatdatetime() and the cdate() didn't get along, aparently. I suppose
cdate is long and formatdatetime is date? Your code didn't provide the
concatenated sentence, but proved to make it possible. And you were right to
leave me some work ;-)

I now have:
==========================================
Dim time1, time2
result = InputBox("Type a date in the dd-mm-jjjj format and click
OK","Serial number for date", Date, 100, 100)
MyLong = Cdate(result)
MyLong1 = clng(mylong)
Response = MsgBox ("The serial value for " & MyLong & " is " & MyLong1,
vbokonly, "Serial number for date")
==========================================

I cannot help the wisecrack though:
In your earlier post you were very eloquent against spam that suggests
enhancing your manhood.
Would that also be the reason you chose this name for your variable:
"MyLong1"?
You are probably one of those naturally endowed with something that needs no
improvement... ;-)
As for me, I'm considering whether to allow your Long1 in my script.

By the way: you were completely right in pointing out I gave the wrong
serial for july 8, 2003. I copied it off a note I made while experimenting
and chose the wrong one... Then again: I told you I needed this gadget! I'll
never get it wrong again, now.

Thanks a lot for your efficient assistance.

Have a marvelous day!

--
Eric van Uden
at the foot of the 'bridge too far'


"Robert Cohen" <jerrygarcia@gratefuldead.com> schreef in bericht
news:OzzvpZWRDHA.2232@TK2MSFTNGP11.phx.gbl...
> okay, I got it. This works
>
> Dim time1, time2
>
> result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
> "Serial number for date", Date, 100, 100)
>
> MyLong = Cdate(result)
> MyLong1 = clng(mylong)
>
> time1 = FormatDateTime(result, 1)
>
> Response = MsgBox (MyLong1, vbokonly, time1)
>
> --
>
> "Eric van Uden" <ericvanuden@supermail.nl> wrote in message
> news:eowmdyVRDHA.3880@tk2msftngp13.phx.gbl...
> > Hello Michael,
> >
> > Your answer is great if I only need to know the value for today.
> > But the purpose of the inputbox was to allow any date to be entered.
> > clng, cdate, ... doesn't work.
> >
> > Thank for your suggestion, though.
> >
> > In the mean time I came up with a solution:
> >
> > =========================================================
> > Dim time1, time2
> >
> > result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
> > "Serial number
> >
> > for date", Date, 100, 100)
> >
> > time1 = FormatDateTime(result, 1)
> > time2 = cdate(result) - cdate(0)
> >
> > Response = MsgBox (time2, vbokonly, time1)
> > ============================================================
> >
> > This still leaves me with the concatenation thing. I cannot find a way
to
> > get a string of text and the values for time1 and time2 into the
> messagebox
> > as a single sentence. One line or more lines isn't the big thing, but
> > pasting the stuff together in something like this way:
> >
> > MsgBox ("The serial for " + time1 + " is " + time2, vbokonly, "Serial
for
> > date")
> >
> > Have a splendid day,
> >
> >
> > --
> > Eric van Uden
> > at the foot of the 'bridge too far'
> >
> > "Michael Dunn" <m_odunn@yahoo.com> schreef in bericht
> > news:uUHx$MPRDHA.1804@TK2MSFTNGP11.phx.gbl...
> > >
> > > "Eric van Uden" <ericvanuden@supermail.nl> wrote in message
> > news:O1lZnVORDHA.2148@TK2MSFTNGP10.phx.gbl...
> > > : Hello newsgroup,
> > > :
> > > : I need a little gadget that will show me the serial number for a
date
> I
> > > : enter. I have come up with the code below, but I can not get it to
> show
> > the
> > > : serial number that the computer uses for the input date. The date
> keeps
> > > : getting converted to the systems (short) date format. In Excel, I
can
> do
> > it
> > > : by entering a date in a cell that is not date-formatted, but I need
a
> > > : quicker way, to fire from my desktop. Here's the basic code I'm
> > > : experimenting with:
> > > :
> > > : ===============================================
> > > : Dim time1, time2
> > > :
> > > : result = InputBox("Type a date in the dd-mm-jjjj format and click
OK",
> > > : "Serial number for date", Date, 100, 100)
> > > :
> > > : time1 = FormatDateTime(result, 1)
> > > : time2 = result
> > > :
> > > : Response = MsgBox (time2, vbokonly, time1)
> > > : ================================================
> > > :
> > > : A related problem: I wanted to concatenate a string for the
messagebox
> > that
> > > : shows the result, but I keep coming up with errors that I think say
> that
> > I
> > > : cannot use text together wit a set variable or a function. I can do
> this
> > in
> > > : Excel VBA without any problem, so I suppose there must be a way.
> Here's
> > the
> > > : gist of what I tried (with the above code):
> > > :
> > > : Response = MsgBox ("The serial number for " + time1 + " is " + time2
+
> > ".",
> > > : vbokonly, "Serial number for date")
> > > :
> > > : I know I should have taken the course, but please help me out.
> > > :
> > > :
> > > : Have a nice day,
> > > :
> > > :
> > > : --
> > > : Eric van Uden
> > > : at the foot of the 'bridge too far'
> > >
> > >
> > > msgbox date() & vbnewline & clng(date())
> > >
> > >
> >
> >
>
>



Re: Show serial for date in messagebox by Robert

Robert
Tue Jul 08 16:17:31 CDT 2003

that is funny, I didn't even notice the MyLong1

believe it or not, microsoft's script repository uses it. I didn't even key
in on that (especially after my comments). That is just way to funny.

but just to prove I am not a pervert; here is from the 5.6 script
repository. But yes I am sorry for putting MyLong1 in your script without
asking. Is that some form of script-rape. :-). If you look under CLng,
the respository has:
Dim MyVal1, MyVal2, MyLong1, MyLong2
MyVal1 = 25427.45: MyVal2 = 25427.55 ' MyVal1, MyVal2 are Doubles.
MyLong1 = CLng(MyVal1) ' MyLong1 contains 25427.
MyLong2 = CLng(MyVal2) ' MyLong2 contains 25428.

--
Sorry, I am no longer including my e-mail address as I am getting to much
spam. I really have no desire to enlarge "it" by three inches, that is even
if I get e-mailed 10 times a day from different e-mail addresses so I can't
block it.
Besides I finally came to believe what others have said, if you have a
question, you should ask the group as others might benefit from it. Anyone
on the group who I converse with off topic or on the side, can easily find
my e-mail address.


"Eric van Uden" <ericvanuden@supermail.nl> wrote in message
news:e6ZGk4YRDHA.2148@TK2MSFTNGP10.phx.gbl...
> Hi Robert,
>
> You cracked it!
>
> The code I came up with and posted back was OK in representing the date
> serial, but didn't allow for the composite sentence I was looking for. The
> formatdatetime() and the cdate() didn't get along, aparently. I suppose
> cdate is long and formatdatetime is date? Your code didn't provide the
> concatenated sentence, but proved to make it possible. And you were right
to
> leave me some work ;-)
>
> I now have:
> ==========================================
> Dim time1, time2
> result = InputBox("Type a date in the dd-mm-jjjj format and click
> OK","Serial number for date", Date, 100, 100)
> MyLong = Cdate(result)
> MyLong1 = clng(mylong)
> Response = MsgBox ("The serial value for " & MyLong & " is " & MyLong1,
> vbokonly, "Serial number for date")
> ==========================================
>
> I cannot help the wisecrack though:
> In your earlier post you were very eloquent against spam that suggests
> enhancing your manhood.
> Would that also be the reason you chose this name for your variable:
> "MyLong1"?
> You are probably one of those naturally endowed with something that needs
no
> improvement... ;-)
> As for me, I'm considering whether to allow your Long1 in my script.
>
> By the way: you were completely right in pointing out I gave the wrong
> serial for july 8, 2003. I copied it off a note I made while experimenting
> and chose the wrong one... Then again: I told you I needed this gadget!
I'll
> never get it wrong again, now.
>
> Thanks a lot for your efficient assistance.
>
> Have a marvelous day!
>
> --
> Eric van Uden
> at the foot of the 'bridge too far'
>
>
> "Robert Cohen" <jerrygarcia@gratefuldead.com> schreef in bericht
> news:OzzvpZWRDHA.2232@TK2MSFTNGP11.phx.gbl...
> > okay, I got it. This works
> >
> > Dim time1, time2
> >
> > result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
> > "Serial number for date", Date, 100, 100)
> >
> > MyLong = Cdate(result)
> > MyLong1 = clng(mylong)
> >
> > time1 = FormatDateTime(result, 1)
> >
> > Response = MsgBox (MyLong1, vbokonly, time1)
> >
> > --
> >
> > "Eric van Uden" <ericvanuden@supermail.nl> wrote in message
> > news:eowmdyVRDHA.3880@tk2msftngp13.phx.gbl...
> > > Hello Michael,
> > >
> > > Your answer is great if I only need to know the value for today.
> > > But the purpose of the inputbox was to allow any date to be entered.
> > > clng, cdate, ... doesn't work.
> > >
> > > Thank for your suggestion, though.
> > >
> > > In the mean time I came up with a solution:
> > >
> > > =========================================================
> > > Dim time1, time2
> > >
> > > result = InputBox("Type a date in the dd-mm-jjjj format and click OK",
> > > "Serial number
> > >
> > > for date", Date, 100, 100)
> > >
> > > time1 = FormatDateTime(result, 1)
> > > time2 = cdate(result) - cdate(0)
> > >
> > > Response = MsgBox (time2, vbokonly, time1)
> > > ============================================================
> > >
> > > This still leaves me with the concatenation thing. I cannot find a way
> to
> > > get a string of text and the values for time1 and time2 into the
> > messagebox
> > > as a single sentence. One line or more lines isn't the big thing, but
> > > pasting the stuff together in something like this way:
> > >
> > > MsgBox ("The serial for " + time1 + " is " + time2, vbokonly, "Serial
> for
> > > date")
> > >
> > > Have a splendid day,
> > >
> > >
> > > --
> > > Eric van Uden
> > > at the foot of the 'bridge too far'
> > >
> > > "Michael Dunn" <m_odunn@yahoo.com> schreef in bericht
> > > news:uUHx$MPRDHA.1804@TK2MSFTNGP11.phx.gbl...
> > > >
> > > > "Eric van Uden" <ericvanuden@supermail.nl> wrote in message
> > > news:O1lZnVORDHA.2148@TK2MSFTNGP10.phx.gbl...
> > > > : Hello newsgroup,
> > > > :
> > > > : I need a little gadget that will show me the serial number for a
> date
> > I
> > > > : enter. I have come up with the code below, but I can not get it to
> > show
> > > the
> > > > : serial number that the computer uses for the input date. The date
> > keeps
> > > > : getting converted to the systems (short) date format. In Excel, I
> can
> > do
> > > it
> > > > : by entering a date in a cell that is not date-formatted, but I
need
> a
> > > > : quicker way, to fire from my desktop. Here's the basic code I'm
> > > > : experimenting with:
> > > > :
> > > > : ===============================================
> > > > : Dim time1, time2
> > > > :
> > > > : result = InputBox("Type a date in the dd-mm-jjjj format and click
> OK",
> > > > : "Serial number for date", Date, 100, 100)
> > > > :
> > > > : time1 = FormatDateTime(result, 1)
> > > > : time2 = result
> > > > :
> > > > : Response = MsgBox (time2, vbokonly, time1)
> > > > : ================================================
> > > > :
> > > > : A related problem: I wanted to concatenate a string for the
> messagebox
> > > that
> > > > : shows the result, but I keep coming up with errors that I think
say
> > that
> > > I
> > > > : cannot use text together wit a set variable or a function. I can
do
> > this
> > > in
> > > > : Excel VBA without any problem, so I suppose there must be a way.
> > Here's
> > > the
> > > > : gist of what I tried (with the above code):
> > > > :
> > > > : Response = MsgBox ("The serial number for " + time1 + " is " +
time2
> +
> > > ".",
> > > > : vbokonly, "Serial number for date")
> > > > :
> > > > : I know I should have taken the course, but please help me out.
> > > > :
> > > > :
> > > > : Have a nice day,
> > > > :
> > > > :
> > > > : --
> > > > : Eric van Uden
> > > > : at the foot of the 'bridge too far'
> > > >
> > > >
> > > > msgbox date() & vbnewline & clng(date())
> > > >
> > > >
> > >
> > >
> >
> >
>
>