#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If (Vlookup 0) working, but what if Vlookup cell does not exist Steve Excel Worksheet Functions 18 November 18th 09 07:33 PM
VLookUp - Does the VLookUp return the exact information? Cpviv Excel Worksheet Functions 2 October 28th 08 09:57 AM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) MikeR-Oz New Users to Excel 1 March 22nd 06 09:01 AM


All times are GMT +1. The time now is 06:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"