ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Time Entry (https://www.excelbanter.com/new-users-excel/30323-time-entry.html)

Iladki

Time Entry
 
A simple problem I would appreciate your help with.

I have a work sheet with several cells where time is to be entered in the
format hh:mm. Unfortunately a lot of users are enetering it in the format
hh.mm.
Is there any way I can automatically convert to the right format, or not
accept the (.) but only (:).

Thanks for your help.



mangesh_yadav


Private Sub Worksheet_Change(ByVal Target As Range)

If InStr(1, Target.Text, ":", vbTextCompare) < 1 Then
MsgBox "invalid entry"
End If

End Sub


Enter the above code in the sheets module



Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378378



All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com