+ Reply to Thread
Results 1 to 5 of 5

VBA VLookUp range moving down a row or across a column

Hybrid View

  1. #1
    Registered User
    Join Date
    02-23-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    10

    VBA VLookUp range moving down a row or across a column

    Hi Guys,

    I was really hoping you can help here. I have a bit of code that I've been creating the issue is the VBA range keeps on shifting every time I run the macro. The Workbook has some set formulas in the cells. I've read that I should name ranges but I think there are too many. please could someone be so kind and assist, it's driving me insane. Thanks in advance

    Example Range A:AA becomes B:AA or A:AB etc
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: VBA VLookUp range moving down a row or across a column

    Hello relo,

    What did you expect to happen once columns were inserted into the worksheet ?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    02-23-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    10

    Re: VBA VLookUp range moving down a row or across a column

    Hi Leith, thanks for replying, much apprecaited. I expect the formula to remain static as intended.

    For example in G12 the formula is =VLOOKUP(--RIGHT(C12,8),Tenant!A:BI,20,FALSE)

    This will change once the macro is run to =VLOOKUP(--RIGHT(C12,8),Tenant!B:BK,20,FALSE) therefore producing N/A and this happenens for every formula.

    Thanks

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: VBA VLookUp range moving down a row or across a column

    What about fixing the formula
    =VLOOKUP(--RIGHT(C12,8),Tenant!$A:$BI,20,FALSE)
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  5. #5
    Registered User
    Join Date
    02-23-2015
    Location
    London
    MS-Off Ver
    2013
    Posts
    10

    Re: VBA VLookUp range moving down a row or across a column

    Thought that initially but no difference. Example of a recent run

    Pre macro
    =VLOOKUP(--RIGHT(C12,8),Tenant!$A:$BI,20,FALSE)

    post macro
    =VLOOKUP(--RIGHT(C12,8),Tenant!$B:$BL,20,FALSE)

    So every result becomes #N/A

    Any other ideas, thanks again in advance

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Moving a range one column to the right without losing the cell references
    By phook01 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-21-2013, 10:11 AM
  2. [SOLVED] Single column countif with moving range based on today's date
    By JonesyCC in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-16-2013, 02:45 PM
  3. Dynamic named range for columns...moving one column over
    By amartino44 in forum Excel General
    Replies: 7
    Last Post: 09-13-2013, 02:31 AM
  4. Moving a range within a column to the next column
    By KasyM in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-18-2013, 12:40 AM
  5. [SOLVED] Moving Range Selection Right One Column at a Time
    By TexDad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2005, 03:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1