khalid79m
03-19-2009, 09:31 AM
Dim cell As String
With Range("Talk_Time")
cell = .Cells(1, 1).Address(False, False)
.Locked = False
.NumberFormat = "hh:mm:ss"
.Validation.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, Operator:=xlGreater, _
Formula1:="=AND(" & cell & ">=TIME(0,0,1)," & cell & "<=TIME(23,59,59))"
.Validation.IgnoreBlank = False
.Validation.ErrorTitle = "Time Error"
.Validation.ErrorMessage = "Please Enter Hours, Minutes & Seconds in this format 01:20:00"
.Validation.ShowError = True
.WrapText = False
.ColumnWidth = 12
.Interior.ColorIndex = 43
.EntireColumn.Hidden = False
End With
my code, here works but only one problem I only want it to
.NumberFormat = "hh:mm:ss"
blank cells within range talktime.
how can i do this ?
With Range("Talk_Time")
cell = .Cells(1, 1).Address(False, False)
.Locked = False
.NumberFormat = "hh:mm:ss"
.Validation.Add Type:=xlValidateCustom, AlertStyle:=xlValidAlertStop, Operator:=xlGreater, _
Formula1:="=AND(" & cell & ">=TIME(0,0,1)," & cell & "<=TIME(23,59,59))"
.Validation.IgnoreBlank = False
.Validation.ErrorTitle = "Time Error"
.Validation.ErrorMessage = "Please Enter Hours, Minutes & Seconds in this format 01:20:00"
.Validation.ShowError = True
.WrapText = False
.ColumnWidth = 12
.Interior.ColorIndex = 43
.EntireColumn.Hidden = False
End With
my code, here works but only one problem I only want it to
.NumberFormat = "hh:mm:ss"
blank cells within range talktime.
how can i do this ?