Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box if cell value not in specific range
How do I display a message box if a specific cell does not equal a given
number (say 100)? Assume that I have two worksheets (Sheet1 and Sheet2) in a workbook. If cell b7 in Sheet1 does not equal 100, I would like a message box to appear to the user stating "Please review the numbers." The only control for the message box should be an OK button. After the OK button is clicked, it should return the user to cell a1 in Sheet1. --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box if cell value not in specific range
why don't you use the data validation in excel. click data then validation and fill in the relevant details.
Otherwise insert this code onto the worksheet.. Private Sub Worksheet_Change(ByVal Target As Range) If Range("B7") < 100 Then MsgBox ("Please revise the numbers") Range("A1").Select End If End Sub This will promt the user about the error evertime the sheet is changed. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calcuting sum of specific word "P" within specific cell range (A5: | Excel Worksheet Functions | |||
Pop up message upon specific cell entry? | Excel Discussion (Misc queries) | |||
Protecting a Range of Specific Cell/s | Excel Discussion (Misc queries) | |||
Protecting a Range of Specific Cell/s | Setting up and Configuration of Excel | |||
Protecting a Range of Specific Cell/s | New Users to Excel |