View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default VBA data validation

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