+ Reply to Thread
Results 1 to 6 of 6

vlookup iserror with autofill to dynamic range - changing array/col index

  1. #1
    Registered User
    Join Date
    02-06-2014
    Location
    derby
    MS-Off Ver
    Excel 2013
    Posts
    8

    vlookup iserror with autofill to dynamic range - changing array/col index

    Hi all

    first off I apologise as I am struggling to explain what I want to do:

    I am trying to do vlookups (excel 2010) with the result of "unknown" if there is an error on a column of varying length, autofilling to the last row of adjacent column.

    The current code I have works fine, however I want to include this in a loop where the vlookup values/array/column index number change depending on which worksheet the value has been taken from. I have tried to use application.vlookup and application.worksheetfunction.vlookup in the past but autofill only fills the first value not its formula.



    Please Login or Register  to view this content.

    any idea how I can use vlookup (including an 'unknown' on error) that I can assign preset values for the table array and index number that can be autofilled down a column of varying length?



    thank you for trying to understand my question!
    Last edited by squarahollier; 05-02-2014 at 04:19 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: vlookup iserror with autofill to dynamic range - changing array/col index

    Suggest you add code tags before you get "moderated". In the meantime, I'll have a look at it ...
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: vlookup iserror with autofill to dynamic range - changing array/col index

    Code tags please, before I can provide a possible solution.


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

  4. #4
    Registered User
    Join Date
    02-06-2014
    Location
    derby
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: vlookup iserror with autofill to dynamic range - changing array/col index

    Apologies, here is the same code with code tags. I wrote this after a day of staring at various code annoyances so I accidentally missed rule 3

    first off I apologise as I am struggling to explain what I want to do:

    I am trying to do vlookups (excel 2010) with the result of "unknown" if there is an error on a column of varying length, autofilling to the last row of adjacent column.

    The current code I have works fine, however I want to include this in a loop where the vlookup values/array/column index number change depending on which worksheet the value has been taken from. I have tried to use application.vlookup and application.worksheetfunction.vlookup in the past but autofill only fills the first value not its formula.

    Please Login or Register  to view this content.


    any idea how I can use vlookup (including an 'unknown' on error) that I can assign preset values for the table array and index number that can be autofilled down a column of varying length?



    thank you for trying to understand my question!

  5. #5
    Registered User
    Join Date
    02-06-2014
    Location
    derby
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: vlookup iserror with autofill to dynamic range - changing array/col index

    Apologies, here is the same code with code tags. I wrote this after a day of staring at various code annoyances so I accidentally missed rule 3


    Please Login or Register  to view this content.


    any idea how I can use vlookup (including an 'unknown' on error) that I can assign preset values for the table array and index number that can be autofilled down a column of varying length?



    thank you for trying to understand my question!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: vlookup iserror with autofill to dynamic range - changing array/col index

    Thanks for complying with the rules ... resistance is futile

    Please Login or Register  to view this content.

    Regards, TMS

+ 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] Excel VBA: changing hard coded column to dynamic range to autofill to last row
    By AishaSanz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-25-2014, 11:40 AM
  2. [SOLVED] Using INDIRECT with a dynamic range name as the array in an INDEX formulae = #REF
    By Gandalf21 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2013, 09:27 AM
  3. [SOLVED] Help with Array IF-ISERROR-INDEX formula
    By Leaoni in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-15-2012, 04:06 PM
  4. Dynamic or Variable Lookup array in INDEX, MATCH or VLOOKUP
    By kishor_c in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-16-2012, 09:46 AM
  5. Vlookup and autofill a dynamic range
    By ajay1967 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2012, 07:36 PM

Tags for this Thread

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