LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,344
Default restricting data entry to non-times

Hi,

My first attempt to Post this appeared to fail, so here goes again:

You can also use the following macro which incorporates a couple of other
potentially useful ideas:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Err1
If Intersect(Target, [A1:B30]) Is Nothing Then Exit Sub
With Target
If Left(.NumberFormat, 1) = "h" Then
Application.EnableEvents = False
.Clear
.Select
MsgBox "Times are not allowed."
End If
End With
Err1:
Application.EnableEvents = True
End Sub

--
Cheers,
Shane Devenshire


" wrote:

I actually need to have entries in some cells to be numbers or text
but NOT times.
Thus I need the cells formatted as General. General formatting makes
10:00 show up as 0.416667. I need data entries to be restricted to
non-
times. Can I have data validation set up to restrict time entries only
but still be able to enter numbers that can be used in formulas?
I have tried =Right(A1,3)=":" in the custom setting under data
validation but
that doesn't seem to workThanks


 
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
Restricting data entry to unique entries only in a specific range Illya Teideman Excel Discussion (Misc queries) 10 August 30th 07 01:08 PM
Restricting data entry to A-Z a-z 0-9 Illya Teideman Excel Discussion (Misc queries) 10 August 28th 07 07:33 PM
Restricting entry in B1 on the basis of entry in A1 Biff Excel Worksheet Functions 0 December 3rd 05 03:41 AM
Restricting data entry JT Excel Programming 1 August 19th 05 08:39 PM
Help With Restricting Values in Data Entry Forms please Carnage Excel Programming 1 May 27th 04 11:41 AM


All times are GMT +1. The time now is 12:59 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"