PC Review


Reply
Thread Tools Rate Thread

How to assign unit for TimeValue?

 
 
Eric
Guest
Posts: n/a
 
      3rd Jun 2010
I would like to input the number of minutes in cell A1 to set the Time Value,
as shown below there is 30 in cell A1 (Unit - minute).
Does anyone have any suggestions on how to the value retrieve from cell A1
is under minute unit?
Thanks in advance for any suggestions
Eric

Sheets("Date").Range(A1).Value,

TimeValue(Sheets("Date").Range(A1).Value)

TimeValue("00:30:00")


 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      3rd Jun 2010
Divide by 1440 will convert that to excel time format....

Sub Macro()
'with 30 in cell A1
Range("B1") = Range("A1") / 1440
Range("B1").NumberFormat = "[h]:mm:ss"

End Sub

--
Jacob (MVP - Excel)


"Eric" wrote:

> I would like to input the number of minutes in cell A1 to set the Time Value,
> as shown below there is 30 in cell A1 (Unit - minute).
> Does anyone have any suggestions on how to the value retrieve from cell A1
> is under minute unit?
> Thanks in advance for any suggestions
> Eric
>
> Sheets("Date").Range(A1).Value,
>
> TimeValue(Sheets("Date").Range(A1).Value)
>
> TimeValue("00:30:00")
>
>

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      3rd Jun 2010
Timevalue () expects a string as below

(taken from help)
Dim MyTime
MyTime = TimeValue("4:35:17 PM")

Could you please elaborate what is your requirement here....

--
Jacob (MVP - Excel)


"Eric" wrote:

> When I assign the value within cell B1, the TimeValue function is not working.
> Do you have any suggestions?
> Thanks in advance for any suggestions
> Eric
>
> Sheets("Date").Range("B1") = Range("A1") / 1440
> Sheets("Date").Range("B1").NumberFormat = "[h]:mm:ss"
>
> TimeValue(Sheets("Date").Range("B1").Value)
>
> "Jacob Skaria" wrote:
>
> > Divide by 1440 will convert that to excel time format....
> >
> > Sub Macro()
> > 'with 30 in cell A1
> > Range("B1") = Range("A1") / 1440
> > Range("B1").NumberFormat = "[h]:mm:ss"
> >
> > End Sub
> >
> > --
> > Jacob (MVP - Excel)
> >
> >
> > "Eric" wrote:
> >
> > > I would like to input the number of minutes in cell A1 to set the Time Value,
> > > as shown below there is 30 in cell A1 (Unit - minute).
> > > Does anyone have any suggestions on how to the value retrieve from cell A1
> > > is under minute unit?
> > > Thanks in advance for any suggestions
> > > Eric
> > >
> > > Sheets("Date").Range(A1).Value,
> > >
> > > TimeValue(Sheets("Date").Range(A1).Value)
> > >
> > > TimeValue("00:30:00")
> > >
> > >

 
Reply With Quote
 
Eric
Guest
Posts: n/a
 
      3rd Jun 2010
When I assign the value within cell B1, the TimeValue function is not working.
Do you have any suggestions?
Thanks in advance for any suggestions
Eric

Sheets("Date").Range("B1") = Range("A1") / 1440
Sheets("Date").Range("B1").NumberFormat = "[h]:mm:ss"

TimeValue(Sheets("Date").Range("B1").Value)

"Jacob Skaria" wrote:

> Divide by 1440 will convert that to excel time format....
>
> Sub Macro()
> 'with 30 in cell A1
> Range("B1") = Range("A1") / 1440
> Range("B1").NumberFormat = "[h]:mm:ss"
>
> End Sub
>
> --
> Jacob (MVP - Excel)
>
>
> "Eric" wrote:
>
> > I would like to input the number of minutes in cell A1 to set the Time Value,
> > as shown below there is 30 in cell A1 (Unit - minute).
> > Does anyone have any suggestions on how to the value retrieve from cell A1
> > is under minute unit?
> > Thanks in advance for any suggestions
> > Eric
> >
> > Sheets("Date").Range(A1).Value,
> >
> > TimeValue(Sheets("Date").Range(A1).Value)
> >
> > TimeValue("00:30:00")
> >
> >

 
Reply With Quote
 
Eric
Guest
Posts: n/a
 
      3rd Jun 2010
Dim MyTime
MyTime = TimeValue("4:35:17 PM")

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?
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
TimeValue function.
TimeValue(string), which string is equal to "00:30:00"

Do you have any suggestions on how to do it?
Thanks in advance for any suggestions
Eric

"Jacob Skaria" wrote:

> Timevalue () expects a string as below
>
> (taken from help)
> Dim MyTime
> MyTime = TimeValue("4:35:17 PM")
>
> Could you please elaborate what is your requirement here....
>
> --
> Jacob (MVP - Excel)
>
>
> "Eric" wrote:
>
> > When I assign the value within cell B1, the TimeValue function is not working.
> > Do you have any suggestions?
> > Thanks in advance for any suggestions
> > Eric
> >
> > Sheets("Date").Range("B1") = Range("A1") / 1440
> > Sheets("Date").Range("B1").NumberFormat = "[h]:mm:ss"
> >
> > TimeValue(Sheets("Date").Range("B1").Value)
> >
> > "Jacob Skaria" wrote:
> >
> > > Divide by 1440 will convert that to excel time format....
> > >
> > > Sub Macro()
> > > 'with 30 in cell A1
> > > Range("B1") = Range("A1") / 1440
> > > Range("B1").NumberFormat = "[h]:mm:ss"
> > >
> > > End Sub
> > >
> > > --
> > > Jacob (MVP - Excel)
> > >
> > >
> > > "Eric" wrote:
> > >
> > > > I would like to input the number of minutes in cell A1 to set the Time Value,
> > > > as shown below there is 30 in cell A1 (Unit - minute).
> > > > Does anyone have any suggestions on how to the value retrieve from cell A1
> > > > is under minute unit?
> > > > Thanks in advance for any suggestions
> > > > Eric
> > > >
> > > > Sheets("Date").Range(A1).Value,
> > > >
> > > > TimeValue(Sheets("Date").Range(A1).Value)
> > > >
> > > > TimeValue("00:30:00")
> > > >
> > > >

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      3rd Jun 2010
Try VBA()

Timeserial(0,30,0)

--
Jacob (MVP - Excel)


"Eric" wrote:

> Dim MyTime
> MyTime = TimeValue("4:35:17 PM")
>
> 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?
> 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
> TimeValue function.
> TimeValue(string), which string is equal to "00:30:00"
>
> Do you have any suggestions on how to do it?
> Thanks in advance for any suggestions
> Eric
>
> "Jacob Skaria" wrote:
>
> > Timevalue () expects a string as below
> >
> > (taken from help)
> > Dim MyTime
> > MyTime = TimeValue("4:35:17 PM")
> >
> > Could you please elaborate what is your requirement here....
> >
> > --
> > Jacob (MVP - Excel)
> >
> >
> > "Eric" wrote:
> >
> > > When I assign the value within cell B1, the TimeValue function is not working.
> > > Do you have any suggestions?
> > > Thanks in advance for any suggestions
> > > Eric
> > >
> > > Sheets("Date").Range("B1") = Range("A1") / 1440
> > > Sheets("Date").Range("B1").NumberFormat = "[h]:mm:ss"
> > >
> > > TimeValue(Sheets("Date").Range("B1").Value)
> > >
> > > "Jacob Skaria" wrote:
> > >
> > > > Divide by 1440 will convert that to excel time format....
> > > >
> > > > Sub Macro()
> > > > 'with 30 in cell A1
> > > > Range("B1") = Range("A1") / 1440
> > > > Range("B1").NumberFormat = "[h]:mm:ss"
> > > >
> > > > End Sub
> > > >
> > > > --
> > > > Jacob (MVP - Excel)
> > > >
> > > >
> > > > "Eric" wrote:
> > > >
> > > > > I would like to input the number of minutes in cell A1 to set the Time Value,
> > > > > as shown below there is 30 in cell A1 (Unit - minute).
> > > > > Does anyone have any suggestions on how to the value retrieve from cell A1
> > > > > is under minute unit?
> > > > > Thanks in advance for any suggestions
> > > > > Eric
> > > > >
> > > > > Sheets("Date").Range(A1).Value,
> > > > >
> > > > > TimeValue(Sheets("Date").Range(A1).Value)
> > > > >
> > > > > TimeValue("00:30:00")
> > > > >
> > > > >

 
Reply With Quote
 
Modeste
Guest
Posts: n/a
 
      3rd Jun 2010
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
@+

 
Reply With Quote
 
Modeste
Guest
Posts: n/a
 
      3rd Jun 2010
Bonsour® "Eric" a écrit
> I would like to input the number of minutes in cell A1 to set the Time
> Value,
> as shown below there is 30 in cell A1 (Unit - minute).
> Does anyone have any suggestions on how to the value retrieve from cell A1
> is under minute unit?


In other words :
;o)))
http://www.cpearson.com/excel/DateTimeEntry.htm

HTH
@+

 
Reply With Quote
 
Eric
Guest
Posts: n/a
 
      3rd Jun 2010
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
> @+
>

 
Reply With Quote
 
Modeste
Guest
Posts: n/a
 
      3rd Jun 2010
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)))


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Need instructions on purging memory for HP Officejet 300 All-in-one- Turned unit off during printing. Now unit prints endless garbage characters in page header even after being unplugged for 1+ Days **jt** Computer Hardware 3 12th Feb 2007 01:23 PM
Rounding unit prices to the nearest unit =?Utf-8?B?TUxNYXJ0aW4=?= Microsoft Word Document Management 2 6th Nov 2005 07:28 AM
timevalue over 24 hours Karen Microsoft Excel Worksheet Functions 6 21st May 2004 11:14 PM
Printing on a Win95 Unit to a Shared Printer on a Win2k Unit Brett Microsoft Windows 2000 Printing 0 24th Jan 2004 05:18 PM
Need Help with Code - TimeValue Donnie Stone Microsoft Excel Programming 1 4th Oct 2003 04:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:55 PM.