ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search In Sheet using macro (https://www.excelbanter.com/excel-programming/288318-search-sheet-using-macro.html)

slideman

Search In Sheet using macro
 
Hello,

I will explain my problem :
I have a workbook with 3 sheet.
I want to search if a value exist in one of the sheet, and if it exist
I want it to say true, if not exist false.
I need it by VBA macro, and not with Lookup.

Thanks for you help, :D


---
Message posted from http://www.ExcelForum.com/


Ron de Bruin

Search In Sheet using macro
 
Try this slideman

Sub test()
If Application.WorksheetFunction.CountIf _
(Sheets("Sheet1").Cells, "ron") = 0 Then
MsgBox "False"
Else
MsgBox "True"
End If
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"slideman " wrote in message ...
Hello,

I will explain my problem :
I have a workbook with 3 sheet.
I want to search if a value exist in one of the sheet, and if it exist
I want it to say true, if not exist false.
I need it by VBA macro, and not with Lookup.

Thanks for you help, :D


---
Message posted from http://www.ExcelForum.com/




slideman[_2_]

Search In Sheet using macro
 
Thanks !!!

It works great ........

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:25 AM.

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