Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Entering Seconds but displaying minutes & seconds

I'm trying to set up a spreadsheet so that I can enter seconds into a variety
of cells e.g. 85 but I want it to be displayed as 1:25 when looking at the
spreadsheet.

Can anyone help ?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Entering Seconds but displaying minutes & seconds

You could use a helper cell with a formula:

=A1/24/60/60

And format it as mm:ss (or your favorite format)



DaveWHAC wrote:

I'm trying to set up a spreadsheet so that I can enter seconds into a variety
of cells e.g. 85 but I want it to be displayed as 1:25 when looking at the
spreadsheet.

Can anyone help ?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Entering Seconds but displaying minutes & seconds

Hi Dave,

Thanks for that, but I was trying to avoid using other cells to reference
back to. Ideally I want to type in 85 in the cell and have that same cell
format it as 1:25

Any other suggestions ?

DaveWHAC

"Dave Peterson" wrote:

You could use a helper cell with a formula:

=A1/24/60/60

And format it as mm:ss (or your favorite format)



DaveWHAC wrote:

I'm trying to set up a spreadsheet so that I can enter seconds into a variety
of cells e.g. 85 but I want it to be displayed as 1:25 when looking at the
spreadsheet.

Can anyone help ?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Entering Seconds but displaying minutes & seconds

You could use a worksheet event.

Rightclick on the worksheet tab that should have this behavior and select view
code. Then paste this in:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

With Target
If .Cells.Count 1 Then Exit Sub
If Intersect(.Cells, Me.Range("a:a")) Is Nothing Then
Exit Sub
End If

On Error GoTo ErrHandler:

If IsNumeric(.Value) Then
If Int(.Value) = .Value Then
Application.EnableEvents = False
.Value = .Value / 24 / 60 / 60
.NumberFormat = "mm:ss"
End If
End If
End With

ErrHandler:
Application.EnableEvents = True

End Sub

Change the range that needs the conversion. I used A:A.

DaveWHAC wrote:

Hi Dave,

Thanks for that, but I was trying to avoid using other cells to reference
back to. Ideally I want to type in 85 in the cell and have that same cell
format it as 1:25

Any other suggestions ?

DaveWHAC

"Dave Peterson" wrote:

You could use a helper cell with a formula:

=A1/24/60/60

And format it as mm:ss (or your favorite format)



DaveWHAC wrote:

I'm trying to set up a spreadsheet so that I can enter seconds into a variety
of cells e.g. 85 but I want it to be displayed as 1:25 when looking at the
spreadsheet.

Can anyone help ?


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Entering Seconds but displaying minutes & seconds

Hi Dave,

Sorry to be a pest but I'm still struggling with this. I've cut and pasted
what you typed into the view code, made my range c:h as those are the columns
I wanted to affect, but typing in 85 in cell c5 (top left of the range)
generates 00:00 and the formula at the top reads 26/3/1904 00:00:00

Many thanks

DaveWHAC

"Dave Peterson" wrote:

You could use a worksheet event.

Rightclick on the worksheet tab that should have this behavior and select view
code. Then paste this in:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

With Target
If .Cells.Count 1 Then Exit Sub
If Intersect(.Cells, Me.Range("a:a")) Is Nothing Then
Exit Sub
End If

On Error GoTo ErrHandler:

If IsNumeric(.Value) Then
If Int(.Value) = .Value Then
Application.EnableEvents = False
.Value = .Value / 24 / 60 / 60
.NumberFormat = "mm:ss"
End If
End If
End With

ErrHandler:
Application.EnableEvents = True

End Sub

Change the range that needs the conversion. I used A:A.

DaveWHAC wrote:

Hi Dave,

Thanks for that, but I was trying to avoid using other cells to reference
back to. Ideally I want to type in 85 in the cell and have that same cell
format it as 1:25

Any other suggestions ?

DaveWHAC

"Dave Peterson" wrote:

You could use a helper cell with a formula:

=A1/24/60/60

And format it as mm:ss (or your favorite format)



DaveWHAC wrote:

I'm trying to set up a spreadsheet so that I can enter seconds into a variety
of cells e.g. 85 but I want it to be displayed as 1:25 when looking at the
spreadsheet.

Can anyone help ?

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Entering Seconds but displaying minutes & seconds

It sounds like events are disabled.

Try closing excel and restarting excel, then reopen your workbook. Make sure
you answer yes to enable macros (and make sure tools|macro|security level is set
for medium or low before you open that workbook).

ps. if you get March 26, 1904, this means that you are using the 1904 date
system. This won't affect the macro, but it could cause trouble if you
copy|paste dates from one workbook to another workbook that doesn't use 1904
date system.

Most pcs use 1900 and most macs use 1904--but it's your choice.

Be aware that if you do change this base date, then all your existing dates will
be off by 4 years and one day.



DaveWHAC wrote:

Hi Dave,

Sorry to be a pest but I'm still struggling with this. I've cut and pasted
what you typed into the view code, made my range c:h as those are the columns
I wanted to affect, but typing in 85 in cell c5 (top left of the range)
generates 00:00 and the formula at the top reads 26/3/1904 00:00:00

Many thanks

DaveWHAC

"Dave Peterson" wrote:

You could use a worksheet event.

Rightclick on the worksheet tab that should have this behavior and select view
code. Then paste this in:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

With Target
If .Cells.Count 1 Then Exit Sub
If Intersect(.Cells, Me.Range("a:a")) Is Nothing Then
Exit Sub
End If

On Error GoTo ErrHandler:

If IsNumeric(.Value) Then
If Int(.Value) = .Value Then
Application.EnableEvents = False
.Value = .Value / 24 / 60 / 60
.NumberFormat = "mm:ss"
End If
End If
End With

ErrHandler:
Application.EnableEvents = True

End Sub

Change the range that needs the conversion. I used A:A.

DaveWHAC wrote:

Hi Dave,

Thanks for that, but I was trying to avoid using other cells to reference
back to. Ideally I want to type in 85 in the cell and have that same cell
format it as 1:25

Any other suggestions ?

DaveWHAC

"Dave Peterson" wrote:

You could use a helper cell with a formula:

=A1/24/60/60

And format it as mm:ss (or your favorite format)



DaveWHAC wrote:

I'm trying to set up a spreadsheet so that I can enter seconds into a variety
of cells e.g. 85 but I want it to be displayed as 1:25 when looking at the
spreadsheet.

Can anyone help ?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Entering Seconds but displaying minutes & seconds

Hi Dave,

That's it sorted now, and it was far from simple. I wouldn't have ever got
to that point with it!!

Don't know if you are meant to reply with thanks as I've not used this
before, but thanks for all your efforts.

DaveWHAC

"Dave Peterson" wrote:

It sounds like events are disabled.

Try closing excel and restarting excel, then reopen your workbook. Make sure
you answer yes to enable macros (and make sure tools|macro|security level is set
for medium or low before you open that workbook).

ps. if you get March 26, 1904, this means that you are using the 1904 date
system. This won't affect the macro, but it could cause trouble if you
copy|paste dates from one workbook to another workbook that doesn't use 1904
date system.

Most pcs use 1900 and most macs use 1904--but it's your choice.

Be aware that if you do change this base date, then all your existing dates will
be off by 4 years and one day.



DaveWHAC wrote:

Hi Dave,

Sorry to be a pest but I'm still struggling with this. I've cut and pasted
what you typed into the view code, made my range c:h as those are the columns
I wanted to affect, but typing in 85 in cell c5 (top left of the range)
generates 00:00 and the formula at the top reads 26/3/1904 00:00:00

Many thanks

DaveWHAC

"Dave Peterson" wrote:

You could use a worksheet event.

Rightclick on the worksheet tab that should have this behavior and select view
code. Then paste this in:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

With Target
If .Cells.Count 1 Then Exit Sub
If Intersect(.Cells, Me.Range("a:a")) Is Nothing Then
Exit Sub
End If

On Error GoTo ErrHandler:

If IsNumeric(.Value) Then
If Int(.Value) = .Value Then
Application.EnableEvents = False
.Value = .Value / 24 / 60 / 60
.NumberFormat = "mm:ss"
End If
End If
End With

ErrHandler:
Application.EnableEvents = True

End Sub

Change the range that needs the conversion. I used A:A.

DaveWHAC wrote:

Hi Dave,

Thanks for that, but I was trying to avoid using other cells to reference
back to. Ideally I want to type in 85 in the cell and have that same cell
format it as 1:25

Any other suggestions ?

DaveWHAC

"Dave Peterson" wrote:

You could use a helper cell with a formula:

=A1/24/60/60

And format it as mm:ss (or your favorite format)



DaveWHAC wrote:

I'm trying to set up a spreadsheet so that I can enter seconds into a variety
of cells e.g. 85 but I want it to be displayed as 1:25 when looking at the
spreadsheet.

Can anyone help ?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Entering Seconds but displaying minutes & seconds

Glad it worked ok.

And "thank you" replies are always welcome.



DaveWHAC wrote:

Hi Dave,

That's it sorted now, and it was far from simple. I wouldn't have ever got
to that point with it!!

Don't know if you are meant to reply with thanks as I've not used this
before, but thanks for all your efforts.

DaveWHAC

"Dave Peterson" wrote:

It sounds like events are disabled.

Try closing excel and restarting excel, then reopen your workbook. Make sure
you answer yes to enable macros (and make sure tools|macro|security level is set
for medium or low before you open that workbook).

ps. if you get March 26, 1904, this means that you are using the 1904 date
system. This won't affect the macro, but it could cause trouble if you
copy|paste dates from one workbook to another workbook that doesn't use 1904
date system.

Most pcs use 1900 and most macs use 1904--but it's your choice.

Be aware that if you do change this base date, then all your existing dates will
be off by 4 years and one day.



DaveWHAC wrote:

Hi Dave,

Sorry to be a pest but I'm still struggling with this. I've cut and pasted
what you typed into the view code, made my range c:h as those are the columns
I wanted to affect, but typing in 85 in cell c5 (top left of the range)
generates 00:00 and the formula at the top reads 26/3/1904 00:00:00

Many thanks

DaveWHAC

"Dave Peterson" wrote:

You could use a worksheet event.

Rightclick on the worksheet tab that should have this behavior and select view
code. Then paste this in:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

With Target
If .Cells.Count 1 Then Exit Sub
If Intersect(.Cells, Me.Range("a:a")) Is Nothing Then
Exit Sub
End If

On Error GoTo ErrHandler:

If IsNumeric(.Value) Then
If Int(.Value) = .Value Then
Application.EnableEvents = False
.Value = .Value / 24 / 60 / 60
.NumberFormat = "mm:ss"
End If
End If
End With

ErrHandler:
Application.EnableEvents = True

End Sub

Change the range that needs the conversion. I used A:A.

DaveWHAC wrote:

Hi Dave,

Thanks for that, but I was trying to avoid using other cells to reference
back to. Ideally I want to type in 85 in the cell and have that same cell
format it as 1:25

Any other suggestions ?

DaveWHAC

"Dave Peterson" wrote:

You could use a helper cell with a formula:

=A1/24/60/60

And format it as mm:ss (or your favorite format)



DaveWHAC wrote:

I'm trying to set up a spreadsheet so that I can enter seconds into a variety
of cells e.g. 85 but I want it to be displayed as 1:25 when looking at the
spreadsheet.

Can anyone help ?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Coverting seconds, to minutes and seconds JaB Excel Worksheet Functions 1 August 4th 06 11:06 AM
Calculating and Adding Hours, Minutes, and Seconds in a CALL LOG EmanJR Excel Worksheet Functions 1 August 3rd 06 04:47 PM
How do I sum increments of minutes and seconds SandyMichalski Excel Worksheet Functions 5 February 2nd 06 04:02 PM
Sum minutes and seconds to total hours deck4 Excel Discussion (Misc queries) 3 August 29th 05 03:34 PM
Entering minutes and seconds burrowsybobs Excel Discussion (Misc queries) 8 June 17th 05 10:09 AM


All times are GMT +1. The time now is 04:35 PM.

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"