Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Text Validation

Is there a way to require a user to enter text into a field (text field)
after data is entered into another field. This isn't a form. Just a regular
Excel worksheet. I thought I could use the text length validation criteria
and uncheck the Ignore Blank option, but no luck. Is this functionality even
possible? Thank you. Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Text Validation

This works for one cell. I need to validate text for a range of cells.
Also, if I select OK from the MsgBox and don't enter the data and move on to
another cell and enter data, the MsgBox is displayed again, but my active
cell isn't where the data is required. Is there a way to validate data for a
range as well as place the cursor back to the cell where the text is
required? Thank you for your assistance. Paul

"Charles Harmon" wrote:

Paul,
Have you tried a Worksheet_Change Event? You can set it to validate the
range in question.
This is something simple it goes in the sheet code you are working on.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Range("A1")
If IsEmpty(rng) Then
MsgBox "HI"
End If

End Sub


Charles

"Paul K." <Paul wrote in message
...
Is there a way to require a user to enter text into a field (text field)
after data is entered into another field. This isn't a form. Just a
regular
Excel worksheet. I thought I could use the text length validation
criteria
and uncheck the Ignore Blank option, but no luck. Is this functionality
even
possible? Thank you. Paul




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Text Validation

Paul,

Try this.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim myarray As Variant
Dim mycnt As Integer
myarray = Array("A1", "B2", "C3")<<<<< You need to add the cells you want to
check
With Worksheets("sheet1")
For mycnt = 1 To UBound(myarray)
If .Range(myarray(mycnt)).Value = "" Then
MsgBox "I'M Sorry missing information : " & myarray(mycnt)
.Range(myarray(mycnt)).Select
Exit Sub
End If
Next
End With
End Sub
Put code in the workbook module.
"Paul K." wrote in message
...
This works for one cell. I need to validate text for a range of cells.
Also, if I select OK from the MsgBox and don't enter the data and move on
to
another cell and enter data, the MsgBox is displayed again, but my active
cell isn't where the data is required. Is there a way to validate data
for a
range as well as place the cursor back to the cell where the text is
required? Thank you for your assistance. Paul

"Charles Harmon" wrote:

Paul,
Have you tried a Worksheet_Change Event? You can set it to validate the
range in question.
This is something simple it goes in the sheet code you are working on.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Range("A1")
If IsEmpty(rng) Then
MsgBox "HI"
End If

End Sub


Charles

"Paul K." <Paul wrote in message
...
Is there a way to require a user to enter text into a field (text
field)
after data is entered into another field. This isn't a form. Just a
regular
Excel worksheet. I thought I could use the text length validation
criteria
and uncheck the Ignore Blank option, but no luck. Is this
functionality
even
possible? Thank you. Paul






Reply
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
Data Validation for text only Kimberly Excel Discussion (Misc queries) 6 November 8th 06 02:26 AM
Validation - Weekend Or text jnk101 Excel Worksheet Functions 3 September 24th 05 09:02 AM
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 12:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"