Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You need to use find with the option lookat:=xlpart. Since the number may be in the middle of a number you have to strip off the leading zeroes and check that the number matches like the code below. If you have a number with leading zeroes it may be a string so you need to use the VAL function to remove the leading zeroes. Yo also have to use FindNext becuae the 1st occurance of the number found may not be the one you are looking for. FindNum = "0000063060003" FindNumNoLeading = val(FinNum) Found = false set c = columns("A").find(what:=FindNumNoLeading, _ lookin:=xlvalues,lookat:=xlpart) if not c is nothing then FirstAddr = c.address Do 'remove leading zeroes from found number and compare if Val(c) = FindNumNoLeading then Found = True exit Do end if set c = columns("A").findnext(after:=c) loop while not c is nothing and c.address < FirstAddr end if -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?u=229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=195154 http://www.thecodecage.com/forumz |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To find rate of each item from item.xls and to copy price.xls | Excel Discussion (Misc queries) | |||
Find and copy data | Excel Worksheet Functions | |||
Find rows with a common item and find or highlight difference | Excel Programming | |||
how do i find multiple matches of one data item in an excel range | Excel Discussion (Misc queries) | |||
Find All and then Copy the Data... | Excel Programming |