+ Reply to Thread
Results 1 to 5 of 5

A Range in an Array causing macro to fail

  1. #1
    Registered User
    Join Date
    01-13-2009
    Location
    Prince Rupert, BC
    MS-Off Ver
    Excel 97, 2003
    Posts
    54

    A Range in an Array causing macro to fail

    I'm working on a project where I need to match up names in the same row but in 2 different columns. A have a macro written to work the way I want. I'm using names from Column D in an array and using the find function to match names in Column A. The successful find results is placed in Column B.

    Presently, I'm adding the names from Column D into the array manually. I have tried adding these programmatically, but the macro fails.

    Hoping someone will spot where I'm going wrong.

    Please Login or Register  to view this content.
    Thanks
    Mister P
    Attached Files Attached Files
    Last edited by Mister P; 12-30-2011 at 06:57 AM.

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,794

    Re: A Range in an Array causing macro to fail

    If you only whish to match names perhaps a code like this will do?

    Please Login or Register  to view this content.
    Alf
    Last edited by Alf; 12-30-2011 at 06:45 AM.

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: A Range in an Array causing macro to fail

    MyArr - a two dimensional array, so you need to specify the row and column for each element of the array, ie MyArr(i, 1)
    try this
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-13-2009
    Location
    Prince Rupert, BC
    MS-Off Ver
    Excel 97, 2003
    Posts
    54

    Re: A Range in an Array causing macro to fail

    Thanks Alf, I'm looking to have the macro match names that may not be spelled exactly the same.

    Mister P

  5. #5
    Registered User
    Join Date
    01-13-2009
    Location
    Prince Rupert, BC
    MS-Off Ver
    Excel 97, 2003
    Posts
    54

    Re: A Range in an Array causing macro to fail

    Hi nilem,
    Your corrections on the use of the array provides the exact results I was after. Thanks you so much.

    Mister P

+ 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