Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Array VLOOKUP lookup_Value does not increment

Is there a way to make B2 increment as the formula is filled down the columns?
As is, all formulas are identical.

Is it because it's a array formula that prevents the increments?
I increments on the sheet if done manually but not in the code.

Thanks,
Howard

Sub VLook()

Dim LRow As Long

LRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("C2:F" & LRow).FormulaArray = "=VLOOKUP(B2,Sheet3!$B$2:$F$10,{2,3,4,5},0)"
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Array VLOOKUP lookup_Value does not increment

Hi Howard,

Am Wed, 30 Jul 2014 11:12:47 -0700 (PDT) schrieb L. Howard:

Is there a way to make B2 increment as the formula is filled down the columns?
As is, all formulas are identical.

Is it because it's a array formula that prevents the increments?
I increments on the sheet if done manually but not in the code.


try:

Sub VLook()

Dim LRow As Long

LRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("C2:F2").FormulaArray =
"=VLOOKUP(B2,Sheet3!$B$2:$F$10,{2,3,4,5},0)"
Range("C2:F2").AutoFill Range("C2:F" & LRow)
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Array VLOOKUP lookup_Value does not increment

Hi Howard,

Am Wed, 30 Jul 2014 20:19:14 +0200 schrieb Claus Busch:

Sub VLook()


I guess you want:

Sub VLook()

Dim LRow As Long

LRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("C2:F" & LRow).Formula = _
"=VLOOKUP($B2,Sheet3!$B$2:$F$10,column(B2),0)"

End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Array VLOOKUP lookup_Value does not increment



I guess you want:



Sub VLook()



Dim LRow As Long



LRow = Cells(Rows.Count, "B").End(xlUp).Row

Range("C2:F" & LRow).Formula = _

"=VLOOKUP($B2,Sheet3!$B$2:$F$10,column(B2),0)"



End Sub





Regards

Claus B.

--



They both work, I suspect the second one, non array, is a better choice.

Fills down and to the right.

Thanks Claus.
Howard
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
Vlookup for multiple Lookup_value [email protected] Excel Programming 1 September 17th 09 12:02 AM
VLOOKUP with multiple lookup_value's AJT Excel Discussion (Misc queries) 3 July 6th 09 06:22 PM
VLOOKUP on partial lookup_value Faraz A. Qureshi Excel Discussion (Misc queries) 8 June 12th 09 05:57 AM
vlookup lookup_value ATIHelp Excel Worksheet Functions 5 July 18th 07 07:12 AM
Vlookup(lookup_value) TSulit Excel Worksheet Functions 1 February 22nd 07 04:23 PM


All times are GMT +1. The time now is 05:09 PM.

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

About Us

"It's about Microsoft Excel"