Excel

Closed
milan - Dec 21, 2009 at 12:46 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Dec 21, 2009 at 07:48 PM
Hello,
i am working about ime sheat,i always i have to put the ( : ) in each time i have to do so many or this is possible to set time without put ( : ), eg:- 03:45 i need to set this time like that 345 and this should be change directly 3:45
please help me
Related:

2 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Dec 21, 2009 at 06:51 AM
Obviously the
se time entries are made in a particular column 

suppose that column is A(column no. 1)
In that case
right click the sheet tab and click view code
in the window that pops up copy this event code

Private Sub Worksheet_Change(ByVal Target As Range)
Dim vvalue
Application.EnableEvents = False
On Error GoTo exiting
If Target.Column <> 1 Then Exit Sub
vvalue = ((Left(Target, Len(Target) - 2) & ":" & Right(Target, 2)))
Target.Clear
Target.Value = vvalue
exiting:
Application.EnableEvents = True
End Sub


save the file

and now type 345 in any cell in column A see what happens

if the time entry is not in column A then the statement in the code
If Target.Column <> 1 Then Exit Sub
may be changed into
if target.column<>(the correct column number) then exit sub

then again test the code by entering in that column some number like 345

I am sure you an modify the code like this if necessary.

post confirmation whether this is ok
0
closeup22 Posts 8923 Registration date Friday May 15, 2009 Status Member Last seen October 7, 2010 2,099
Dec 21, 2009 at 08:11 AM
hi there,

what is the office version thet you are using?

please give more information

Thanks
0
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Dec 21, 2009 at 07:48 PM
windows xp excel 2002
0