Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bellz
 
Posts: n/a
Default Cell format changing on the fly


Is there a way to format a cell so that if you enter a time, such as
entering :30 into A3, and having Excel automatically changing that
value to decimal, in this case, .50?

So if I enter :30, hit enter, and it changes to .50 in the same cell?

Thanks!


--
bellz
------------------------------------------------------------------------
bellz's Profile: http://www.excelforum.com/member.php...o&userid=30429
View this thread: http://www.excelforum.com/showthread...hreadid=500990

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bellz
 
Posts: n/a
Default Cell format changing on the fly


Anybody have any ideas?


--
bellz
------------------------------------------------------------------------
bellz's Profile: http://www.excelforum.com/member.php...o&userid=30429
View this thread: http://www.excelforum.com/showthread...hreadid=500990

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default Cell format changing on the fly

Bellz,
First of all, (at least my version of) Excel does not accept :30 as
time. It is accepted as text.

With this said, your job can be done with an event macro:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If Left(Target.Value, 1) = ":" And IsNumeric(Mid(Target.Value, 2,
Len(Target.Value))) Then
Target.Value = CInt(Mid(Target.Value, 2, Len(Target.Value))) / 60
End If
End Sub

Press Alt+F11 to bring up the VBA IDE.
At the top left is the Project Explorer window.
Under the workbook you want to work with there is the icon
ThisWorkbook.
Double-click the icon to bring up the VBA code page for the workbook.
Paste the above code.

HTH
Kostis Vezerides

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
" / " Changing Decimal number format to Fraction on Protected Cell laudie Excel Worksheet Functions 0 November 15th 05 01:12 AM
Cond. Format & Absolute Cell Reference Question nastech Excel Discussion (Misc queries) 4 November 9th 05 05:02 PM
how do I format a cell reference to move as source changes KGray Excel Worksheet Functions 1 August 13th 05 12:41 AM
can't format cell - have tried unlocking and unprotecting griffin Excel Discussion (Misc queries) 1 April 5th 05 02:11 AM
difficulty changing cell format samsmimi Excel Worksheet Functions 4 April 1st 05 12:25 AM


All times are GMT +1. The time now is 05:15 AM.

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"