Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VLookUP ARRAY , how can I make it not relative in macro?
Hi, so all is great with ONE exception, when I insert VLookUP with a macro, the array is inserting relative to the insert cell. How can I make it refer to a fixed array? Below is the code I have. The code is searching for a word and then inserting the Vlookup in the cell to the right of the word. Thanks Patrick Sub Insert_VLOOKUP_FULL() Dim Findfirst As Object, FindNext As Object, FindNext2 As Object Set Findfirst = Cells.Find(What:="ATM CARDS", LookIn:=xlValues) If Not Findfirst Is Nothing Then Findfirst.Select With Range("A" & Findfirst.Row & ":F" & Findfirst.Row).Borders(xlEdgeTop) ActiveCell.Offset(, 4) = "=VLOOKUP(RC[-5],'Product per Call'!R[-2]C[-5]:R[484]C[10],16,FALSE)" End With Set FindNext2 = Findfirst Do Set FindNext = Cells.FindNext(After:=FindNext2) If Not FindNext Is Nothing Then With Range("A" & FindNext.Row & ":F" & FindNext.Row).Borders(xlEdgeTop) ActiveCell.Offset(, 4) = "=VLOOKUP(RC[-5],'Product per Call'!R[-2]C[-5]:R[484]C[10],16,FALSE)" End With End If Set FindNext2 = FindNext FindNext2.Interior.ColorIndex = 0 FindNext2.Select Loop Until FindNext.Address = Findfirst.Address -- crowdx42 ------------------------------------------------------------------------ crowdx42's Profile: http://www.excelforum.com/member.php...o&userid=37749 View this thread: http://www.excelforum.com/showthread...hreadid=573897 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Vlookup -Want to make table of array optional | Excel Discussion (Misc queries) | |||
How do i make a macro "relative" to cell? | Excel Discussion (Misc queries) | |||
Make macro-button sheet reference relative | Excel Programming | |||
Relative Position in VBA Array | Excel Programming | |||
Cannot make macro relative | Excel Programming |