Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default VLOOKUP anchored cell reference changing when macro runs

I have a vlookup formula in a cell that looks up a record ID in another
workbook and autofills certain data. I have the cell range as $A$2:$Z$30000.
The macro that adds new record #s to the other workbook copies a row of
info. and inserts the row above Row 2 of the sheet. When I go back to the
Vlookup formula, $A$2 has switched to $A$3 (so the formula can never find any
new rows / data added).

I tried to record a macro that pastes the update info at the bottom of the
list (A1 the Ctrl Down Arrow) but the macro doesn't remain relative -- always
going to the same cell and overwriting previous entries. ~ not quite
technical enough ... Questor
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default VLOOKUP anchored cell reference changing when macro runs

Modify your macro to do the insert the new row at row 3 instead of row 2,
that will keep the new row within the previously defined range and Excel will
adjust the end of the range for you: $A$2:$Z$30000 will become $A$2:$Z$30001


"questor" wrote:

I have a vlookup formula in a cell that looks up a record ID in another
workbook and autofills certain data. I have the cell range as $A$2:$Z$30000.
The macro that adds new record #s to the other workbook copies a row of
info. and inserts the row above Row 2 of the sheet. When I go back to the
Vlookup formula, $A$2 has switched to $A$3 (so the formula can never find any
new rows / data added).

I tried to record a macro that pastes the update info at the bottom of the
list (A1 the Ctrl Down Arrow) but the macro doesn't remain relative -- always
going to the same cell and overwriting previous entries. ~ not quite
technical enough ... Questor

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default VLOOKUP anchored cell reference changing when macro runs

Can you use all the rows?

=vlookup(x99,sheet2!$a:$z,18,false)



questor wrote:

I have a vlookup formula in a cell that looks up a record ID in another
workbook and autofills certain data. I have the cell range as $A$2:$Z$30000.
The macro that adds new record #s to the other workbook copies a row of
info. and inserts the row above Row 2 of the sheet. When I go back to the
Vlookup formula, $A$2 has switched to $A$3 (so the formula can never find any
new rows / data added).

I tried to record a macro that pastes the update info at the bottom of the
list (A1 the Ctrl Down Arrow) but the macro doesn't remain relative -- always
going to the same cell and overwriting previous entries. ~ not quite
technical enough ... Questor


--

Dave Peterson
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
how do I release an anchored cell? DarrellGSF Excel Discussion (Misc queries) 5 October 2nd 07 10:01 PM
VLOOKUP Changing reference cells in autofill barry Excel Worksheet Functions 2 September 2nd 06 07:36 PM
One macro runs then it auto runs another macro PG Excel Discussion (Misc queries) 2 September 1st 06 09:30 PM
Changing Cell Reference in a macro on global base ashish128 Excel Discussion (Misc queries) 2 April 20th 06 01:16 PM
Which Macro Runs...? Bill Martin Excel Discussion (Misc queries) 7 September 29th 05 12:42 PM


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

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"