vlookup

  • Thread starter Thread starter jln via OfficeKB.com
  • Start date Start date
J

jln via OfficeKB.com

Im trying to do a row count with a vlookup so that only rows being used down
to the first space are in the vlookup. Here is the code that i have for just
the vlookup. So what im thinking is that i need to change

' Change this line
Set myR3 = Sheets("Modem").Range("Z2:Z4075")

' Change this line
myR3.FormulaR1C1 = "=VLOOKUP(RC[-24],MGICLPMI!R2C4:R621C14,11,0)"

myR3.Copy
myR3.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
myR3.Replace What:="#N/A", Replacement:="0", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
 
with Sheets("Modem")
Set myR3 = .Range(.Cells(2,"Z"),.Cells(2,"Z").End(xldown))
End With

With Worksheets("MGICLPMI")
set myR4 = .Range(.Cells(2,4),.Cells(2,4).End(xldown)).Resize(,13)
End with

myR3.FormulaR1C1 = "=VLOOKUP(RC[-24]," & _
myR4.Address(1,1,xlR1C1,True) & ",11,0)"

--
Regards,
Tom Ogilvy


--
Regards,
Tom Ogilvy


jln via OfficeKB.com said:
Im trying to do a row count with a vlookup so that only rows being used down
to the first space are in the vlookup. Here is the code that i have for just
the vlookup. So what im thinking is that i need to change

' Change this line
Set myR3 = Sheets("Modem").Range("Z2:Z4075")

' Change this line
myR3.FormulaR1C1 = "=VLOOKUP(RC[-24],MGICLPMI!R2C4:R621C14,11,0)"

myR3.Copy
myR3.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
myR3.Replace What:="#N/A", Replacement:="0", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help with my VBA Vloopup 1
conso macro 0
Help with a loop please. 10
vLOOK UP INTO vba 3
find and replace multiple values in one statement 3
Macro on Current Row 1
Slow Macro 7
Replacing "error msg" in VBa 5

Back
Top