+ Reply to Thread
Results 1 to 3 of 3

Help debugging a macro - Searching for a unique string and displaying results

  1. #1
    Registered User
    Join Date
    04-05-2012
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Help debugging a macro - Searching for a unique string and displaying results

    Hi Guys,

    I'm wondering if someone is available to help me debug a macro that I'm working on.

    I'm trying to search for a unique ID from Row 2 of Column A in "G_W_P.xlsm" within multiple sheets (8) of Column A of "G&W - S&C.xlsx" and then display the result within Column B, C, D etc. (if duplicates are found) of "G_W_P.xlsm".

    The problem with my current code (which i've included below) is that the macro runs Ok, but only displays results for about 34 rows (instead of about 400). Also, the macro appears to be innacurate in that it displays the location of unique ID's where they aren't found in that worksheet, or it displays multiple occurences of the same unique ID in the same worksheet. I think it does the latter by confusing unique IDs, for example it thinks that "CBX246-1" is a second occurence of "CBX246".

    There's also a 2 other functions that I would like the macro to do.
    Firstly - I would like to have the macro open "G&W - S&C.xlsx" when I run it in "G_W_P.xlsm" without me having to have it open in the first place as I have to with my macro.
    Secondly - I would also like the macro to display the unique ID's that were searched for in "G&W - S&C.xlsx". I was hoping the macro could create a new worksheet within "G_W_P.xlsm" and display the results in Column A there.

    I've included the working sheets that I've got so far

    Thanking anyone greatly in advance for any assitance.

    The code I have so far is.......
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by arlu1201; 04-07-2012 at 03:27 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Help debugging a macro - Searching for a unique string and displaying results

    Is this the same request as http://www.excelforum.com/excel-prog...ther-file.html

    Also,

    You need to put code tags (as per my signature). I have done it this time, please do so in future.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    04-05-2012
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Help debugging a macro - Searching for a unique string and displaying results

    Hi Arlette,

    Yes it is the same request, but as no one had answered and I had progressed some way with the code. I thought I'd repost for someone to help me debug what I had.

    Also, I said I'm very new, so no idea what code tags are sorry.

    Thanks again for all your assistance with the code so far.

+ 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