ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating Msg. Box (https://www.excelbanter.com/excel-programming/340614-creating-msg-box.html)

[email protected]

Creating Msg. Box
 
Hello!

I am trying to determine if there a value ("ADD") doesn't exist in the
sheet, to end the macro and have a box that says "You must note an Add
line, stupid."

Any ideas?

All I have at this point is a macro that I recorded that will find
"add"


Do
If Cells.Find(What:="add", After:=ActiveCell,
LookIn:=xlFormulas, LookAt:=
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate = False

Thanks Everyone!


Bill[_30_]

Creating Msg. Box
 
Dim Findnot As Object
Cells.Select
Set Findnot = Selection.Find(What:="Add", After:=ActiveCell,
LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False)
If Findnot Is Nothing Then
MsgBox "You must note an ADD line stupid."
End
End If


wrote in message
oups.com...
Hello!

I am trying to determine if there a value ("ADD") doesn't exist in the
sheet, to end the macro and have a box that says "You must note an Add
line, stupid."

Any ideas?

All I have at this point is a macro that I recorded that will find
"add"


Do
If Cells.Find(What:="add", After:=ActiveCell,
LookIn:=xlFormulas, LookAt:=
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate = False

Thanks Everyone!





All times are GMT +1. The time now is 04:03 PM.

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