ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   loop to find cells with specified value (https://www.excelbanter.com/excel-programming/369614-loop-find-cells-specified-value.html)

webby2006[_9_]

loop to find cells with specified value
 

Sorry for a really daft question, I’ve trawled the internet trying t
find this particular method of extract the range value. I have a loo
that looks for cells that contact a particular value, one a cell i
found it should call another sub passing the cell name i.e B3 as a
argument.

Sub FindValueOfCell()
For Each Cell In Range("A1:L40")
If Cell.Value = "Apple" Then
Call DrawBordersFunction(Pass range value to other sub?)
End If
Next
End Su

--
webby200
-----------------------------------------------------------------------
webby2006's Profile: http://www.excelforum.com/member.php...fo&userid=3674
View this thread: http://www.excelforum.com/showthread.php?threadid=56901


Dave Patrick

loop to find cells with specified value
 
Sub FindValueOfCell()
For Each cell In Range("A1:L40")
If Trim(LCase(cell.Value)) = Trim(LCase("Apple")) Then
MsgBox cell.Address
End If
Next
End Sub

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"webby2006" wrote:
|
| Sorry for a really daft question, I've trawled the internet trying to
| find this particular method of extract the range value. I have a loop
| that looks for cells that contact a particular value, one a cell is
| found it should call another sub passing the cell name i.e B3 as an
| argument.
|
| Sub FindValueOfCell()
| For Each Cell In Range("A1:L40")
| If Cell.Value = "Apple" Then
| Call DrawBordersFunction(Pass range value to other sub?)
| End If
| Next
| End Sub
|
|
| --
| webby2006
| ------------------------------------------------------------------------
| webby2006's Profile:
http://www.excelforum.com/member.php...o&userid=36744
| View this thread: http://www.excelforum.com/showthread...hreadid=569010
|



webby2006[_10_]

loop to find cells with specified value
 

Dave
Perfect thank you.


Dave Patrick Wrote:
Sub FindValueOfCell()
For Each cell In Range("A1:L40")
If Trim(LCase(cell.Value)) = Trim(LCase("Apple")) Then
MsgBox cell.Address
End If
Next
End Sub

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


|



--
webby2006
------------------------------------------------------------------------
webby2006's Profile: http://www.excelforum.com/member.php...o&userid=36744
View this thread: http://www.excelforum.com/showthread...hreadid=569010


Dave Patrick

loop to find cells with specified value
 
You're welcome.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"webby2006" wrote:
|
| Dave
| Perfect thank you.




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

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