+ Reply to Thread
Results 1 to 7 of 7

Improvising a vlookup code

  1. #1
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Improvising a vlookup code

    Dear Experts,
    Code below takes about 7.5 mins to fill up the formula and then converting values in the cells
    (Total number of columns rows used in this sheet is 999,999 (which can vary).
    Converting to values is required as sheet 2 will be deleted after few steps.
    Please consider my VBA knowledge as zero as I am learning VBA through net and this forum
    Best Regads/VKS
    Please Login or Register  to view this content.
    Last edited by VKS; 02-07-2013 at 12:11 AM.

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Improvising a vlookup code

    What determines the Activecell address?
    Avoid selecting the cells to speed up the process.

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Improvising a vlookup code

    Doing such huge VLOOKUPs is always likely to be slow, but you could switch to using IFERROR, which would mean that each VLOOKUP only had to be performed once instead of twice:

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Improvising a vlookup code

    Maybe you could use the Find method in VBA instead of VLOOKUP?

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Improvising a vlookup code

    That would be much slower, as the macro would have to loop through all of the cells being written and run the .Find for each one.

  6. #6
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Improvising a vlookup code

    Quote Originally Posted by coreytroy View Post
    What determines the Activecell address?
    Avoid selecting the cells to speed up the process.
    Thanks Coreytroy
    range("a1").Select
    Selection.End(xlToRight).Offset(0, 1).Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    ActiveCell.End(xlDown).Offset(0, -1).Select
    Selection.End(xlUp).Offset(0, 1).Select
    Last edited by VKS; 02-06-2013 at 05:19 AM.

  7. #7
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Improvising a vlookup code

    @ Andrew: wowwwww its 1:58 mins now and you already have my star for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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