Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
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
Calcuting sum of specific word "P" within specific cell range (A5: billy liddel Excel Worksheet Functions 3 September 26th 09 12:17 PM
Pop up message upon specific cell entry? matt ball Excel Discussion (Misc queries) 8 June 14th 08 03:00 PM
Protecting a Range of Specific Cell/s Blacksmith[_2_] Excel Discussion (Misc queries) 1 August 27th 07 04:43 PM
Protecting a Range of Specific Cell/s Blacksmith[_2_] Setting up and Configuration of Excel 1 August 27th 07 04:43 PM
Protecting a Range of Specific Cell/s Blacksmith[_2_] New Users to Excel 1 August 27th 07 04:43 PM


All times are GMT +1. The time now is 07:40 AM.

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"