ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Validation code for macro to run (https://www.excelbanter.com/excel-discussion-misc-queries/59634-validation-code-macro-run.html)

[email protected]

Validation code for macro to run
 
Hi...the code below works fine, but how do I change it so that it
doesn't look for a blank cell (""), but looks for specific text in a
cell? There is an If formula in cell C269 so that if 2 figures balance
then this cell displays "TRUE", otherwise it displays "FALSE".

The code mustn't run if Cell C269 displays "FALSE".

If [C269] = "" Then
MsgBox "The figures don't balance!!"
Exit Sub
End If
Range("E1:E48").Select
Selection.Copy
End Sub

Thanks.

Rob


Paul B

Validation code for macro to run
 
Rob, try this,

If [C269] = "False" Then
MsgBox "The figures don't balance!!"
Exit Sub
End If
Range("E1:E48").Select
Selection.Copy
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

wrote in message
oups.com...
Hi...the code below works fine, but how do I change it so that it
doesn't look for a blank cell (""), but looks for specific text in a
cell? There is an If formula in cell C269 so that if 2 figures balance
then this cell displays "TRUE", otherwise it displays "FALSE".

The code mustn't run if Cell C269 displays "FALSE".

If [C269] = "" Then
MsgBox "The figures don't balance!!"
Exit Sub
End If
Range("E1:E48").Select
Selection.Copy
End Sub

Thanks.

Rob





All times are GMT +1. The time now is 02:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com