Thread: Lookup Macro
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 244
Default Lookup Macro

Try this
Dim x As Rang
x = Worksheets("Sheet2").Columns(2).Find(Left(Range("S heet1!A" & i).value, 3), XlLookAt := xlPart
range("Sheet1!j" & I).value =x.value

I'm not sure if your looking for a whole match value or a partial, so your gonna have to make changes as needed to XlLookA

----- Dthmtlgod wrote: ----

I have the following piece of code. It looks to see if a cell is zer

If Range("Sheet1!J" & I).Value = 0 The

**** This is where I need assistance. If it is zero, then I need to do
lookup on the value o
left(range("Sheet1!A" & i), 3) in another worksheet (Sheet2, column B). I
is trying to find a match on the first three digits of column A to Sheet2
column A, and return the lookup value of B to column Sheet1!J

range("Sheet1!j" & I).value

****
End I

I have been trying to get this to work for a couple of hours now, an
assistance is much appreciated