View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default VBA data validation

I think you may have missed my opening sentence and the <g symbol that
followed it.<bg

--
Rick (MVP - Excel)



"Chip Pearson" wrote in message
...
Why so many lines of code?


Because it makes the logic much easier to understand. One of the
purposes of the newsgroups is, I think, to educate the users rather
than just provide some code that a user can copy/paste without
understanding how it works and what it does.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]



On Sun, 9 May 2010 15:56:15 -0400, "Rick Rothstein"
wrote:

Sorry about the following, but it is Sunday and things are kind of slow
around here.<g

Why so many lines of code?

Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
KeyAscii = -KeyAscii * (Len(TextBox1.Text) < 6 And _
Chr(KeyAscii) Like "#" And KeyAscii < 8)
End Sub