ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   finding variables in a column (https://www.excelbanter.com/excel-programming/282270-finding-variables-column.html)

solo_razor[_31_]

finding variables in a column
 

Hello,

I have the following subroutine
supplier1 = activesheet.range("a1").value

sub matchcriteria
if worksheets("supplier").cells.find(what:=supplier1
after:=activecell, lookin:=xlformulas, lookat:=xlpart
searchorder:=xlbyrows, searchdirection:=xlnext, matchcase := false)
true then (anothersubroutine that copies a row matching that supplier
criteria) else exit sub

The subroutine doesn't work, it won't shutdown when the criteri
(supplier 1) is not found (= false).

The searchable criteria is found in column d, it might make
difference because i am searching the whole sheet now, does anybody no
how i can write a subroutine that will do all of the above for me

regards,
Nie

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


Don Guillett[_4_]

finding variables in a column
 
See if this idea helps

Sub exitfind()
On Error GoTo endit
x = Columns(1).Find("x").Address
MsgBox x
endit:
End Sub
--
Don Guillett
SalesAid Software

"solo_razor" wrote in message
...

Hello,

I have the following subroutine
supplier1 = activesheet.range("a1").value

sub matchcriteria
if worksheets("supplier").cells.find(what:=supplier1,
after:=activecell, lookin:=xlformulas, lookat:=xlpart,
searchorder:=xlbyrows, searchdirection:=xlnext, matchcase := false) =
true then (anothersubroutine that copies a row matching that supplier1
criteria) else exit sub

The subroutine doesn't work, it won't shutdown when the criteria
(supplier 1) is not found (= false).

The searchable criteria is found in column d, it might make a
difference because i am searching the whole sheet now, does anybody now
how i can write a subroutine that will do all of the above for me

regards,
Niek


------------------------------------------------
~~ Message posted from
http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/





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

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