ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Script to find the word END (https://www.excelbanter.com/excel-programming/345943-script-find-word-end.html)

Gary Prescott via OfficeKB.com

Script to find the word END
 
I have a report and the END appears believe it or not at the END!!

However our slave devices are prone to crashes and the full file is not
always outputed. When I use a macro to disect this report I need it to seach
column B and find the word END. If this word is not in the report I need it
flash a pop up warning saying that the full file was not outputed. If its
there there is no need for a prompt

Any ideas??

--
Message posted via http://www.officekb.com

Chip Pearson

Script to find the word END
 
Try something like the following:

Dim FoundCell As Range
Set FoundCell = Range("B:B").Find(what:="END", LookIn:=xlValues,
_
lookat:=xlWhole, MatchCase:=False)
If FoundCell Is Nothing Then
MsgBox "Not Found"
Else
MsgBox "Found at: " & FoundCell.Address
End If




--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Gary Prescott via OfficeKB.com" <u15117@uwe wrote in message
news:578cb6d87a336@uwe...
I have a report and the END appears believe it or not at the
END!!

However our slave devices are prone to crashes and the full
file is not
always outputed. When I use a macro to disect this report I
need it to seach
column B and find the word END. If this word is not in the
report I need it
flash a pop up warning saying that the full file was not
outputed. If its
there there is no need for a prompt

Any ideas??

--
Message posted via http://www.officekb.com




Tom Ogilvy

Script to find the word END
 
if application.Countif(Columns(2),"END") = 0 Then
msgbox "End not found"
End if

--
Regards,
Tom Ogilvy


"Gary Prescott via OfficeKB.com" <u15117@uwe wrote in message
news:578cb6d87a336@uwe...
I have a report and the END appears believe it or not at the END!!

However our slave devices are prone to crashes and the full file is not
always outputed. When I use a macro to disect this report I need it to

seach
column B and find the word END. If this word is not in the report I need

it
flash a pop up warning saying that the full file was not outputed. If its
there there is no need for a prompt

Any ideas??

--
Message posted via http://www.officekb.com





All times are GMT +1. The time now is 06:50 AM.

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