ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vlookup (https://www.excelbanter.com/excel-programming/377411-vlookup.html)

jln via OfficeKB.com

vlookup
 
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


--
Message posted via http://www.officekb.com


Tom Ogilvy

vlookup
 
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" wrote:

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


--
Message posted via http://www.officekb.com




All times are GMT +1. The time now is 02:04 AM.

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