From: Jacob Skaria on
Eric, what is wrong with

Now + timeserial(0,30,0)

--
Jacob (MVP - Excel)


"Eric" wrote:

> A1 = 30
> A2 = A1*"0:1", which show 00:30:00 in hh:mm:ss format
>
> dTime = Now + TimeValue(Sheets("Date").Range("A2").Value)
>
> When I run the macro, there is an error on dTime.
> Do you have any suggestions on how to fix the code? so "00:30:00" can be
> retrieved for TimeValue function.
> Thank everyone very much for any suggestions
> Eric
>
> "Modeste" wrote:
>
> > Bonsour® "Eric" a écrit
> >
> > > Dim MyTime
> > > MyTime = TimeValue("4:35:17 PM")
> >
> > what else ???
> >
> > > If I would like to retrieve the number (in minute unit) and convert into
> > > ("4:35:17 PM") format, could you please give me any suggestions on how
> > to
> > > do it?
> >
> > Sub eric()
> > Dim MyTime As Date
> > MyTime = TimeValue("4:35:17 PM")
> > MsgBox MyTime & vbCrLf & " equal : " & Int(MyTime / TimeValue("0:01")) & "
> > minutes"
> > End Sub
> >
> > > For example, there is 30 in cell A1, which unit is minute, and I would
> > > like
> > > to retrieve 30 value and turn into "00:30:00" string and place it inside
> >
> > in A2 = A1*"0:1"
> > cell format hh:mm:ss
> >
> > HTH
> > @+
> >
From: Eric on
timeserial(0,variable,0) contains a variable, which is retrieved from cell A1.
Do you have any suggestions?
Thank everyone very much for any suggestions
Eric

"Jacob Skaria" wrote:

> Eric, what is wrong with
>
> Now + timeserial(0,30,0)
>
> --
> Jacob (MVP - Excel)
>
>
> "Eric" wrote:
>
> > A1 = 30
> > A2 = A1*"0:1", which show 00:30:00 in hh:mm:ss format
> >
> > dTime = Now + TimeValue(Sheets("Date").Range("A2").Value)
> >
> > When I run the macro, there is an error on dTime.
> > Do you have any suggestions on how to fix the code? so "00:30:00" can be
> > retrieved for TimeValue function.
> > Thank everyone very much for any suggestions
> > Eric
> >
> > "Modeste" wrote:
> >
> > > Bonsour® "Eric" a écrit
> > >
> > > > Dim MyTime
> > > > MyTime = TimeValue("4:35:17 PM")
> > >
> > > what else ???
> > >
> > > > If I would like to retrieve the number (in minute unit) and convert into
> > > > ("4:35:17 PM") format, could you please give me any suggestions on how
> > > to
> > > > do it?
> > >
> > > Sub eric()
> > > Dim MyTime As Date
> > > MyTime = TimeValue("4:35:17 PM")
> > > MsgBox MyTime & vbCrLf & " equal : " & Int(MyTime / TimeValue("0:01")) & "
> > > minutes"
> > > End Sub
> > >
> > > > For example, there is 30 in cell A1, which unit is minute, and I would
> > > > like
> > > > to retrieve 30 value and turn into "00:30:00" string and place it inside
> > >
> > > in A2 = A1*"0:1"
> > > cell format hh:mm:ss
> > >
> > > HTH
> > > @+
> > >
From: Dave Peterson on
With Somecell
.numberformat = "hh:mm:ss"
.value = timeserial(0, workSheets("Date").Range(A1).Value, 0)
end with

Eric wrote:
>
> timeserial(0,variable,0) contains a variable, which is retrieved from cell A1.
> Do you have any suggestions?
> Thank everyone very much for any suggestions
> Eric
>
> "Jacob Skaria" wrote:
>
> > Eric, what is wrong with
> >
> > Now + timeserial(0,30,0)
> >
> > --
> > Jacob (MVP - Excel)
> >
> >
> > "Eric" wrote:
> >
> > > A1 = 30
> > > A2 = A1*"0:1", which show 00:30:00 in hh:mm:ss format
> > >
> > > dTime = Now + TimeValue(Sheets("Date").Range("A2").Value)
> > >
> > > When I run the macro, there is an error on dTime.
> > > Do you have any suggestions on how to fix the code? so "00:30:00" can be
> > > retrieved for TimeValue function.
> > > Thank everyone very much for any suggestions
> > > Eric
> > >
> > > "Modeste" wrote:
> > >
> > > > Bonsour® "Eric" a écrit
> > > >
> > > > > Dim MyTime
> > > > > MyTime = TimeValue("4:35:17 PM")
> > > >
> > > > what else ???
> > > >
> > > > > If I would like to retrieve the number (in minute unit) and convert into
> > > > > ("4:35:17 PM") format, could you please give me any suggestions on how
> > > > to
> > > > > do it?
> > > >
> > > > Sub eric()
> > > > Dim MyTime As Date
> > > > MyTime = TimeValue("4:35:17 PM")
> > > > MsgBox MyTime & vbCrLf & " equal : " & Int(MyTime / TimeValue("0:01")) & "
> > > > minutes"
> > > > End Sub
> > > >
> > > > > For example, there is 30 in cell A1, which unit is minute, and I would
> > > > > like
> > > > > to retrieve 30 value and turn into "00:30:00" string and place it inside
> > > >
> > > > in A2 = A1*"0:1"
> > > > cell format hh:mm:ss
> > > >
> > > > HTH
> > > > @+
> > > >

--

Dave Peterson
From: Eric on
A1 = 2
A2 = 0:02:00
dTime = Now + TimeValue(Sheets("Date").Range("A2").Value)
The macro should be repeated on every two minutes, but it repeated on every
minute, I have already quited excel application and reopen this file to
ensure the initial setting is erased. Do you have any clue?
Thank everyone very much for any suggestions
Eric

"Modeste" wrote:

> Bonsour "Eric" a crit
>
> > A1 = 30
> > A2 = A1*"0:1", which show 00:30:00 in hh:mm:ss format
> >
> > dTime = Now + TimeValue(Sheets("Date").Range("A2").Value)
>
> dTime = Now + Sheets("Date").Range("A2").Value
> or
> dTime = Now + TimeValue(Sheets("Date").Range("A2").Text)
>
> ;o)))
>
>
From: Eric on
I have changed Value into Text.
A1 = 2
A2 = 0:02:00
dTime = Now + TimeValue(Sheets("Date").Range("A2").Text)
The macro should be repeated on every two minutes, but it repeated on every
minute, I have already quited excel application and reopen this file to
ensure the initial setting is erased. Do you have any clue?
Thank everyone very much for any suggestions
Eric


"Modeste" wrote:

> Bonsour "Eric" a crit
>
> > A1 = 30
> > A2 = A1*"0:1", which show 00:30:00 in hh:mm:ss format
> >
> > dTime = Now + TimeValue(Sheets("Date").Range("A2").Value)
>
> dTime = Now + Sheets("Date").Range("A2").Value
> or
> dTime = Now + TimeValue(Sheets("Date").Range("A2").Text)
>
> ;o)))
>
>