LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to do validation ???

I face a problem in validation. How to do the validation whe
programming in VBA? I had do the validation to request user fo
entries. Anyway, I don't know how to do for the following features:
1) For Project Name, it must be enter like this: ?##-####

? = alphabet
#= integer

2) For Hours Spent, it must be enter integer only, and not alphabet o
other sign.

Below is my code:



Private Sub SubmitButton_Click()

Range("C3") = " Project Name "
Range("D3") = " Project Element "
Range("E3") = " Hours Spent "

Sheets("Sheet1").Activate
NextRow = Application.WorksheetFunction.CountA(Range("A:A")) + 4


If TextProjectName.Text = "" Then
MsgBox "You must enter your project name."
Exit Sub
End If

If TextProjectElement.Text = "" Then
MsgBox "You must emter your project element."
Exit Sub
End If

If TextHoursSpent.Value = "" Then
MsgBox "You must enter your hours spent."
Exit Sub
End If

Cells(NextRow, 3) = TextProjectName.Text
Cells(NextRow, 4) = TextProjectElement.Text
Cells(NextRow, 5) = TextHoursSpent.Value

TextProjectName.Text = ""
TextProjectElement.Text = ""
TextHoursSpent.Value = ""

TextProjectName.SetFocus

End Sub




Thousands thanks to anyone that can help me on this matter.
:)

Thanks

--
Message posted from http://www.ExcelForum.com

 
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
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Validation (Drop down list vs simple text length validation) Bob Phillips[_6_] Excel Programming 2 April 27th 04 07:47 PM
Validation (Drop down list vs simple text length validation) Jason Morin[_2_] Excel Programming 1 April 27th 04 04:56 PM
Validation (Drop down list vs simple text length validation) Pete McCosh Excel Programming 0 April 27th 04 03:49 PM


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