Can you toggle on and off, data validation, input messages?

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,352
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a spreadsheet with some data validation input messages to guide the users as to instructions for using it. After they have used the spreadsheet for some time, they will become familiar in the use of it. Can you toggle all the input messages to be either on or off with the press of a button?
 
This appears to me that it should work. It toggles the tips on the first sheet, Start, where the button is, but does nothing to the tips on the second sheet.

VBA Code:
Sub ToggleTips()
    Dim st As Range, qu As Range, ws As Worksheet
    
    For Each ws In ActiveWorkbook.Sheets
        For Each st In ActiveSheet.UsedRange
            If HasValidation(st) Then
                st.Validation.ShowInput = Not st.Validation.ShowInput
            End If
        Next st
    Next ws

        
End Sub
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I found the problem but I am not sure of the syntax to fix it. Disabling the tips works on regular worksheet cells but I also have some tips on cells in an excel table. The code to toggle the regular cells does not work on a table.

VBA Code:
Sub ToggleTips()
    Dim st As Range, cell As Range
  
        For Each st In ActiveSheet.UsedRange
            If HasValidation(st) Then
                st.Validation.ShowInput = Not st.Validation.ShowInput
            End If
        Next st

        For Each cell In Quoting.ListObjects("cssquote")
            If HasValidation(cell) Then
                cell.Validation.ShowInput = Not cell.Validation.ShowInput
            End If
        Next cell
End Sub

The top part of the code works for normal cells and I was trying to add in code that would look at each cell in the table, cssquote and toggle any tips in that but I was not sure of the syntax. Could someone help me with that please?
 
Upvote 0
Don't know why but it is now toggling on/off the cells in the table.
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,413
Members
449,082
Latest member
tish101

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top