Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nick Wright
 
Posts: n/a
Default IF NOT or IS NOT function

I am trying to write a macro to display a message if a certain cell does not
contain certain data. (I am working in Visual Basic)

i.e
If cell F1 = 100 then end
If cell F1 is not 100 then display a message "please re-enter data"

Can anyone please help
  #2   Report Post  
Anne Troy
 
Posts: n/a
Default

You don't need a macro for that, Nick. Try this:
http://www.officearticles.com/excel/...soft_excel.htm
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


Nick Wright" wrote in message
...
I am trying to write a macro to display a message if a certain cell does

not
contain certain data. (I am working in Visual Basic)

i.e
If cell F1 = 100 then end
If cell F1 is not 100 then display a message "please re-enter data"

Can anyone please help



  #3   Report Post  
Nick
 
Posts: n/a
Default

I do need a macro due to the code being written in an existing macro. I have
a sheet with 3 drop down menus. I have got everything to work when a print
preview button is pressed. I now want to idiot prove the program so that if
the numbers in a cell are changed the print preview macro will reconginse
this and display a message. How can i do this?

"Anne Troy" wrote:

You don't need a macro for that, Nick. Try this:
http://www.officearticles.com/excel/...soft_excel.htm
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


Nick Wright" wrote in message
...
I am trying to write a macro to display a message if a certain cell does

not
contain certain data. (I am working in Visual Basic)

i.e
If cell F1 = 100 then end
If cell F1 is not 100 then display a message "please re-enter data"

Can anyone please help




  #4   Report Post  
tina
 
Posts: n/a
Default

Hi Nick
try using something like
If Range("f1") = 100 Then
Else
MsgBox ("please reenter data")
Exit Sub
End If

"Nick" wrote:

I do need a macro due to the code being written in an existing macro. I have
a sheet with 3 drop down menus. I have got everything to work when a print
preview button is pressed. I now want to idiot prove the program so that if
the numbers in a cell are changed the print preview macro will reconginse
this and display a message. How can i do this?

"Anne Troy" wrote:

You don't need a macro for that, Nick. Try this:
http://www.officearticles.com/excel/...soft_excel.htm
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


Nick Wright" wrote in message
...
I am trying to write a macro to display a message if a certain cell does

not
contain certain data. (I am working in Visual Basic)

i.e
If cell F1 = 100 then end
If cell F1 is not 100 then display a message "please re-enter data"

Can anyone please help




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
I NEED HELP with the SPELLNUMBER Function vag Excel Worksheet Functions 0 June 21st 05 08:17 AM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM


All times are GMT +1. The time now is 07:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"