LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default "Or" statement not working

This Macro excerpt is based on a "Check Cell Content before continuing..."
discussion with Bill Renaud back in October.

I works great (thanks Bill) with one exception.

If the cells are changed in reverse order of my "Or" statements (Conditions
3, & 2 are met first) then the Macro continues even though the 1st condition
has not been met.

Every other combination works.

Thanks in advance for any help on this. (Code Below)

'/// Check for Required Fields (Project Number)
If Range("Q44").Value = "Fill in..." Or _
Range("F47").Value = Range("AB2").Value Or _
Range("H56").Value = Range("AH2").Value _
Then
MsgBox "Please fill in the Abbreviation, Project Type, Class, and
Application Date fields (blue font with an *)", _
vbCritical + vbOKOnly, _
"You have not filled in all the fields required to generate a
complete project number."
Exit Sub
Else
'Do macro.
End If

 
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Replace(ActiveCell.Formula, "Round(","") not working as expected Dennis Excel Programming 3 May 16th 07 04:49 PM
embedding "ISERROR" function into an "IF" statement [email protected] Excel Worksheet Functions 8 January 4th 07 12:01 AM
Working out age from "Day" "Month" "Year" timmyc Excel Worksheet Functions 4 February 5th 06 03:07 PM
Call a sub statement in "Personal Macro Workbook" from "ThisWorkbo QC Coug Excel Programming 1 August 26th 05 07:09 PM


All times are GMT +1. The time now is 01:42 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"