Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I print Validation Messages from a worksheet?

Status
Not open for further replies.

casperthedog

Instructor
Jan 29, 2002
20
0
0
NZ
The subject line says it all really.

I have an Excel workbook with many sheets, each containing many validation messages.

Is there an easy way to print them all out?
 
What do you mean by validation messages ??
Do you mean the message that pops up if a user tries to enter an invalid entry in a cell that has data validation ??
Or do you mean something else ?? Rgds
~Geoff~
 
Yes, I mean the message that pops up when a user enters a cell to warn or inform them of input requirements.

Richard.
 
Hmmm - not sure, if you know the ranges that have validation, you can access the messages by:
With Selection.Validation
.InputTitle = "Input Message"
.ErrorTitle = "Error Message"
.InputMessage = "This is a test"
.ErrorMessage = "This is also a test"
.ShowInput = True
.ShowError = True
End With

but I can't see that there is a boolean test for the existence of validation, nor a collection of validation objects to loop thru Rgds
~Geoff~
 
Ok - more progress made:

Sub ListValidationMessages()
ctr = 2 'Assumes a header for the list
For Each cel In ActiveSheet.Cells.SpecialCells(xlCellTypeAllValidation)
IT = cel.Validation.InputTitle
IM = cel.Validation.InputMessage
ET = cel.Validation.ErrorTitle
EM = cel.Validation.ErrorMessage
With Sheets("Sheet2")
.Range("A" & ctr).Value = IT
.Range("B" & ctr).Value = IM
.Range("C" & ctr).Value = ET
.Range("D" & ctr).Value = EM
.Range("E" & ctr).Value = cel.Address
End With
ctr = ctr + 1
Next
End Sub

This doesn't print the messages off 'cos I don't know whether you want input or error messages. What it DOES do is put all the input and error messages in a seperate sheet, in a list

HTH Rgds
~Geoff~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top