+ Reply to Thread
Results 1 to 7 of 7

Unclear by use of CurrentRegion.Address in Macro

  1. #1
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Unclear by use of CurrentRegion.Address in Macro

    I have the Macro which works for this set up:

    Sheet("FindReplace")
    Please Login or Register  to view this content.

    Sheet("Age")
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    But I Can NOT get it to works for this set up (Sheets("Age") remains the same) :

    Sheet("FindReplace2")
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Unclear by use of CurrentRegion.Address in Macro

    Look up works only to the left of the column. You need to rearrange your columns or use I and M.

    Please Login or Register  to view this content.
    Last edited by AB33; 09-30-2015 at 02:05 PM.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Unclear by use of CurrentRegion.Address in Macro

    Hi Capson,
    See the attached which shows how Vlookup works. I personally avoid it and use Index and match.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Unclear by use of CurrentRegion.Address in Macro

    Thank you for both!

    I have used Match in the past and I had a lot of trouble with it it was on a large data set (about 300,000 rows) it seemed slow and prone to throwing errors.

    Maybe it was me and how I used it, but it left me with a avoidance to Match.

    Do you find match to be touchy and slow on large data sets? in particular when Matching across sheets, if you don't I will give it a try again

    I was supersized how fast VLookUp was, which was why I was using it

  5. #5
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Unclear by use of CurrentRegion.Address in Macro

    My experience:

    VLOOKUP() is great for SORTED sets of data; that contributes to its speed.
    MATCH() will search unsorted data sets and therefor is not as fast to do its job.

    Use MATCH() when its needed just once or a few times.
    If searching is needed often, then sort the data set first and search with VLOOKUP()
    If this has been helpful, please click on the star at the left.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Unclear by use of CurrentRegion.Address in Macro

    Yes, I do not like the match function on it own and hardly used it. I prefer a find function which is robust and fast. Index and match (I and M) is a different concept. I do not know if IM is slower than Vlook, but Vlook has some draw backs. It can only return from the left part of the column as I have shown you on the attached. Yes, there are a couple of round ways of this issue, buy why bother. Imagine you insert a new column and as a result the column numbers change, the Vlook will not work, worse it gives a false result as the look column is hard coded. IM does not suffer from this as it use the column as a reference.

  7. #7
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Unclear by use of CurrentRegion.Address in Macro

    Thank you again

+ 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. Using macro to find email address in address book of Outlook
    By danfullwood in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2014, 06:48 AM
  2. [SOLVED] Sort macro using CurrentRegion
    By x65140 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-03-2013, 03:19 PM
  3. Unclear definition of attribute for macro shortcut key combination
    By nuttyengineer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2012, 04:39 AM
  4. Unclear Vlookup parameter
    By xxxploring in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2009, 03:52 AM
  5. tip of the day is unclear
    By 1a2s3d4f in forum Excel General
    Replies: 5
    Last Post: 11-20-2006, 04:28 PM
  6. [SOLVED] Unclear about hot to automate searchs
    By Keith in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-11-2006, 11:40 AM
  7. [SOLVED] Unclear Error Message
    By Yossi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2005, 12:06 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