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

Someone from another forum kindly gave me this code to remove all validation
input messages from a worksheet but it doesn't work or throw any error
messages.
.................................................. ..........................
Sub RemoveValidationInputMsgs()
On Error GoTo None
With
ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllVa lidation).Validation
.InputTitle = Empty
.InputMessage = Empty
End With
None:
On Error GoTo 0
End Sub
.................................................. ..........................
Any help appreciated with this, thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Remove Validation Input Messages

Hi,

It works for me. Note that as written it only works on the active sheet, do
you have the sheet you want it to work on selected?

Mike

"Code Numpty" wrote:

Someone from another forum kindly gave me this code to remove all validation
input messages from a worksheet but it doesn't work or throw any error
messages.
.................................................. .........................
Sub RemoveValidationInputMsgs()
On Error GoTo None
With
ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllVa lidation).Validation
.InputTitle = Empty
.InputMessage = Empty
End With
None:
On Error GoTo 0
End Sub
.................................................. .........................
Any help appreciated with this, thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Remove Validation Input Messages

Your code wouldn't throw any error messages due to use of the error handler,
try commenting On error resume next.

If the code fails it is probably due to mixed validation types on the sheet
or protection. If due to the mixed types it means looping each validation
cell, unless you have some other way of identifying areas that contain same
type of validation..

Sub NoDVinputMsg()
Dim rng As Range, cel As Range
Set rng = Nothing ' only if rng previously set
On Error Resume Next
Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllVa lidation)
If Not rng Is Nothing Then
bDummy = rng.Validation.ShowInput
If Err.Number = 0 Then
' all same type, no need to loop
With rng.Validation
.InputTitle = ""
.InputMessage = ""
End With
Else
On Error GoTo 0
For Each cel In rng
With cel.Validation
.InputTitle = ""
.InputMessage = ""
End With
Next
End If
End If
End Sub

BTW, if you only want to deisable the input messages and not permanently
remove them, just do
..ShowInput = False

Regards,
Peter T





"Code Numpty" wrote in message
...
Someone from another forum kindly gave me this code to remove all

validation
input messages from a worksheet but it doesn't work or throw any error
messages.

.................................................. ..........................
Sub RemoveValidationInputMsgs()
On Error GoTo None
With
ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllVa lidation).Validation
.InputTitle = Empty
.InputMessage = Empty
End With
None:
On Error GoTo 0
End Sub

.................................................. ..........................
Any help appreciated with this, thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Remove Validation Input Messages

Thanks Peter, I commented out On Error GoTo None and On Error GoTo 0 and got
error code 1004 and the debugger highlighted .InputTitle = Empty.

So, I used your code which of course works like a dream, thank you for your
help.
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
Validation: - different messages for defined input values Karuna Excel Discussion (Misc queries) 2 December 24th 07 01:31 PM
Editing Data Validation Input Messages Shelley Excel Discussion (Misc queries) 0 August 17th 07 01:54 AM
Can validation input messages be locked in place? Chris Excel Discussion (Misc queries) 1 March 22nd 06 07:53 PM
Extract Data Validation Input Messages and Titles Dodson Brown Excel Programming 6 April 18th 05 10:16 PM
Remove Data validation Input messages Mark Excel Programming 3 July 2nd 04 04:14 PM


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