Add an Input Message to a Cell - Message Appears When the Cell is Selected in Excel - Data Validation Macro

Add to Favorites
Author:

Add data validation input messages to cells in Excel with this free Excel macro. These messages appear when a specific cell has been selected. The benefit of this type of pop up message in Excel is that when a user goes to enter something in a particular cell, you can display a reminder to that user which can better help them fill out that cell. This works great when it comes to user forms and data entry forms in Excel.

There are two versions of this macro listed below. The first Excel macro adds an input message to a cell that is hard-coded into the macro whereas the second macro adds an input message to any cell that you select before you run the macro.

To use these macros simply change A1 in the first macro to the cell reference where you want to add an input message and change Message Title Goes Here and Message Contents Go Here in both macros in order to have the desired input message displayed.

Where to install the macro:  Module

Add an Input Message to a Specified Cell in Excel

Sub Add_Cell_Input_Message_Cell()

With Range("A1").Validation
 .Add Type:=xlValidateInputOnly
 .InputTitle = "Message Title Goes Here"
 .InputMessage = "Message Contents Go Here"
End With

 End Sub

Add an Input Message to a Selected Cell in Excel

Sub Add_Cell_Input_Message_Selection()

With Selection.Validation
 .Add Type:=xlValidateInputOnly
 .InputTitle = "Message Title Goes Here"
 .InputMessage = "Message Contents Go Here"
End With

 End Sub





Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons 50+ Hours of Instruction 200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course



How to Install the Macro
  1. Select and copy the text from within the grey box above.

  2. Open the Microsoft Excel file in which you would like the Macro to function.

  3. Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.  Or For other ways to get there, Click Here.

  4. On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.

  5. If the Macro goes in a Module, Click Here, otherwise continue to Step 8.

  6. If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.

  7. If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.

  8. Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.

  9. You are now ready to run the macro.

Tutorial Details
Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course