ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   change error message when no more for "find" in macro to find (https://www.excelbanter.com/excel-programming/350356-change-error-message-when-no-more-find-macro-find.html)

swyltm

change error message when no more for "find" in macro to find
 
I have a macro in excel which "find"s a value of "FALSE" in a cell. If there
are no cells with "FALSE" in them, I get a "debug" type error message. I
would rather the computer bring up a message saying "Search complete"

Dave Peterson

change error message when no more for "find" in macro to find
 
Dim FoundCell as range
set foundcell = yourrangetofind.find(yourparmsforfind)

if foundcell is nothing then
msgbox "Search complete"
else
'do what you want
end if

swyltm wrote:

I have a macro in excel which "find"s a value of "FALSE" in a cell. If there
are no cells with "FALSE" in them, I get a "debug" type error message. I
would rather the computer bring up a message saying "Search complete"


--

Dave Peterson


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

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