Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA VLookup Reference Problem

I'm trying to simplify the process of vlookups for others and have trie
the following. This is intended to look at the adjacent cell to th
left(containing a branch code) and fill in the corresponding branc
name. I have the Vlookup data on a hidden sheet in the workbook. M
problem is that the lookup range moves with the active cell. Any hel
would be greatly appreciated.
Thanks,
Scott


Selection.FormulaR1C1 = _
"=VLOOKUP(OFFSET(RC,0,-1),Lookups!R[-1]C[-1]:R[43]C,2,FALSE)"


Selection.Copy

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = Fals

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA VLookup Reference Problem

Can't tell where your lookup range is from your sample because the
references are relative. Change them to absolute

instead of

Lookups!R[-1]C[-1]:R[43]C

something like

Lookups!R43C7:R200C8 Lookups!G43:H200

--
Regards,
Tom Ogilvy


"Scott1523 " wrote in message
...
I'm trying to simplify the process of vlookups for others and have tried
the following. This is intended to look at the adjacent cell to the
left(containing a branch code) and fill in the corresponding branch
name. I have the Vlookup data on a hidden sheet in the workbook. My
problem is that the lookup range moves with the active cell. Any help
would be greatly appreciated.
Thanks,
Scott


Selection.FormulaR1C1 = _
"=VLOOKUP(OFFSET(RC,0,-1),Lookups!R[-1]C[-1]:R[43]C,2,FALSE)"


Selection.Copy

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False


---
Message posted from http://www.ExcelForum.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
vlookup with more than one reference with the same name eddie d Excel Worksheet Functions 8 September 29th 09 02:55 PM
Reference - Vlookup Vanessa Simmonds Excel Discussion (Misc queries) 1 October 5th 08 04:30 PM
Vlookup reference the row below jtoy Excel Worksheet Functions 5 August 1st 07 08:05 AM
VLOOKUP Reference Help Max Excel Discussion (Misc queries) 4 December 19th 05 07:28 PM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


All times are GMT +1. The time now is 11:22 AM.

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"