How can i hide/show input messages with a sub?

MisterExcellent

New Member
Joined
Apr 21, 2011
Messages
46
Hello,

how can i hide and show data-validations- input messages in a workbook with a sub?

I have a lot of input messages which i would like to "hide" and if required "show" in the workbook.

Do you know a suitable solution?
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
You can place the messages in 'shapes', then set the shapes to .Visible=True or .Visible=False when and as each one is required or not.
 
Upvote 0
You can place the messages in 'shapes', then set the shapes to .Visible=True or .Visible=False when and as each one is required or not.

Hi Ruddles,
i found a way to show or hide the messages but how can i use this in a sub with a commandbutton?

Code:
'APJToolTips
Private Sub Worksheet_Change(ByVal Target As Range)

        Dim rng As Range
        Dim cel As Range

        If Target.Address = Me.Range("ShowUserMsg").Address Then
                Set rng = Me.Cells.SpecialCells(xlCellTypeAllValidation)
                For Each cel In rng.Cells
                        With cel.Validation
                                If .InputMessage <> "" Then .ShowInput = Target.Value
                        End With
                Next cel
        End If
End Sub
 
Upvote 0
You could set the button to execute something like:-
Code:
ActiveSheet.Shapes("Shape1").Visible=Not ActiveSheet.Shapes("Shape1").Visible
Change the name of the shape to match whatever your shape is called.

That will toggle Shape1 from visible to not visible and back to visible each time the button is clicked.
 
Upvote 0

Forum statistics

Threads
1,224,560
Messages
6,179,520
Members
452,923
Latest member
JackiG

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