From: Jacob Skaria on
Try

MsgBox Now + TimeSerial(0, Range("A1").Value, 0)

--
Jacob (MVP - Excel)


"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
> > > > @+
> > > >
From: Eric on
The pop up message is 03-Jun-10 11:20:37 PM,
so it cannot retrieve value 2 from cell A1, and return TimeSerial(0,2,0)
Do you have any suggestions?
Thank everyone very much for any suggestions
Eric

"Jacob Skaria" wrote:

> Try
>
> MsgBox Now + TimeSerial(0, Range("A1").Value, 0)
>
> --
> Jacob (MVP - Excel)
>
>
> "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
> > > > > @+
> > > > >
From: Jacob Skaria on
If cell A1 has 2 then the result would be 03-Jun-10 11:20:37 PM PM which is 2
minutes greater than the current time which is 03-Jun-10 11:18:37 PM

--
Jacob (MVP - Excel)


"Eric" wrote:

> The pop up message is 03-Jun-10 11:20:37 PM,
> so it cannot retrieve value 2 from cell A1, and return TimeSerial(0,2,0)
> Do you have any suggestions?
> Thank everyone very much for any suggestions
> Eric
>
> "Jacob Skaria" wrote:
>
> > Try
> >
> > MsgBox Now + TimeSerial(0, Range("A1").Value, 0)
> >
> > --
> > Jacob (MVP - Excel)
> >
> >
> > "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
> > > > > > @+
> > > > > >
From: Eric on
When I use following coding, my macro is repeated running every second.
A1 = 2
dTime = Now + TimeSerial(0, Sheets("Date").Range("A1").Value, 0)
Application.OnTime dTime, "aUpdating"

MsgBox Now + TimeSerial(0, Range("A1").Value, 0) did show the time + 2 mins

When I use following coding, my macro is repeated running every 2 minutes
dTime = Now + TimeSerial(0, 2, 0)
Application.OnTime dTime, "aUpdating"

Do you have any suggestions on what wrong the retrieved value from cell A1?
Thank everyone very much for any suggestions
Eric




"Jacob Skaria" wrote:

> If cell A1 has 2 then the result would be 03-Jun-10 11:20:37 PM PM which is 2
> minutes greater than the current time which is 03-Jun-10 11:18:37 PM
>
> --
> Jacob (MVP - Excel)
>
>
> "Eric" wrote:
>
> > The pop up message is 03-Jun-10 11:20:37 PM,
> > so it cannot retrieve value 2 from cell A1, and return TimeSerial(0,2,0)
> > Do you have any suggestions?
> > Thank everyone very much for any suggestions
> > Eric
> >
> > "Jacob Skaria" wrote:
> >
> > > Try
> > >
> > > MsgBox Now + TimeSerial(0, Range("A1").Value, 0)
> > >
> > > --
> > > Jacob (MVP - Excel)
> > >
> > >
> > > "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
> > > > > > > @+
> > > > > > >
From: Jacob Skaria on
Make sure you have the value 2 in Sheets("Date") and not in the active sheet.

--
Jacob (MVP - Excel)


"Eric" wrote:

> When I use following coding, my macro is repeated running every second.
> A1 = 2
> dTime = Now + TimeSerial(0, Sheets("Date").Range("A1").Value, 0)
> Application.OnTime dTime, "aUpdating"
>
> MsgBox Now + TimeSerial(0, Range("A1").Value, 0) did show the time + 2 mins
>
> When I use following coding, my macro is repeated running every 2 minutes
> dTime = Now + TimeSerial(0, 2, 0)
> Application.OnTime dTime, "aUpdating"
>
> Do you have any suggestions on what wrong the retrieved value from cell A1?
> Thank everyone very much for any suggestions
> Eric
>
>
>
>
> "Jacob Skaria" wrote:
>
> > If cell A1 has 2 then the result would be 03-Jun-10 11:20:37 PM PM which is 2
> > minutes greater than the current time which is 03-Jun-10 11:18:37 PM
> >
> > --
> > Jacob (MVP - Excel)
> >
> >
> > "Eric" wrote:
> >
> > > The pop up message is 03-Jun-10 11:20:37 PM,
> > > so it cannot retrieve value 2 from cell A1, and return TimeSerial(0,2,0)
> > > Do you have any suggestions?
> > > Thank everyone very much for any suggestions
> > > Eric
> > >
> > > "Jacob Skaria" wrote:
> > >
> > > > Try
> > > >
> > > > MsgBox Now + TimeSerial(0, Range("A1").Value, 0)
> > > >
> > > > --
> > > > Jacob (MVP - Excel)
> > > >
> > > >
> > > > "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
> > > > > > > > @+
> > > > > > > >