+ Reply to Thread
Results 1 to 15 of 15

Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated to.

  1. #1
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated to.

    Hi,
    I'm wondering if someone help me to modify the following Code?
    My workbook have two sheets "Records" and "Ouput",
    On Column A2:A37 The sheet Records has Alphanumeric String and
    on Column B2:B37 Has Scores (Alphanumeic as well)
    Note that some String from Col A and Scores Col B are duplicated
    what the code do:
    it get the Scores (Col B2:B37) and copy as unique score on Sheet Output Col M1:M17
    Then extract any String associated to each Score and copy next to it on same sheet Ouput Col O1:V17

    NOTE 1: I need to Paste but starting on Row M2 of Ouput?, is pasting in Row M1, and i can't find where to change it

    NOTE2: The code is working find but on Range N1:V17 is copying unwanted Duplicated String on Single Score Row, It does'nt matter if any other string appear multiples Times on Multiples Scores But Just once (per row).

    See bellow The Ouput with Unwanted Duplicated String that i need to get rid of (red string).


    Score ID __STRING
    40 -----> 15
    20 -----> 18 18
    17 -----> 03 10 06 07
    13 -----> 23 23 23
    12 -----> 14 16 30
    11 -----> 05 12
    9 ------> 32
    8 ------> 23
    3 ------> 34 29 34 29
    5 ------> 09 01
    4 ------> 21 11
    2 ------> 17 20
    1 ------> 33 26 08 04
    0 ------> 02 13 36 28

    The Ouput what i need with Unique String that belong to each score
    ===========================================
    Score ID___STRING
    40 -----> 15
    20 -----> 18
    17 -----> 03 10 06 07
    13 -----> 23
    12 -----> 14 16 30
    11 -----> 05 12
    9 ------> 32
    8 ------> 23
    3 ------> 34 29
    5 ------> 09 01
    4 ------> 21 11
    2 ------> 17 20
    1 ------> 33 26 08 04
    0 ------> 02 13 36 28




    Im using this code
    ============

    Please Login or Register  to view this content.

    Thanks a Millions !!!!

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    For a quit result why not next code
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    Hi Mr PCI

    Run the code and display: Run-Time error Select method of Range Fail


  4. #4
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    The Debug Hilight Rng.Select

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    Hello AndyJr,

    Please try;

    Please Login or Register  to view this content.
    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  6. #6
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    Hi Mr. PCI,

    I'm really sorry for this false/positive (by my side)
    Your code is Working Good, My mistake, when compare to previous Code with yours I left one Breakpoint On.
    and that's why I was getting the error


    I Apologise and Thank you so much!!!!!

  7. #7
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    Hi Winon,


    Thank you but after removing a breakpoint (on the other code) it works fine.

    Btw Thank you for the Error Tips


    Regards

    AndyJr

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    Hello AndyJr,

    You are welcome. Thank you for the Rep+, I appreciate it!

    Glad you could solve your issue.

    Regards.

  9. #9
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    Hi Mr PCI and Winon,

    I have a question: Right now the code is pasting in Col/Row M1 & N1 of sheet "reports", so, where in the code can i modify in order to paste starting in Col/row M2 & N2 ??


    Thanks!
    Last edited by AndyJr; 09-22-2019 at 03:12 PM. Reason: mssg was for PCI and Mr Winon, i just mention Winon

  10. #10
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    The Debug Hilight Rng.Select
    Yes delete this statement, it was for debugging

  11. #11
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    to paste starting in Col/row M2 & N2

    Here a remake
    Please Login or Register  to view this content.

  12. #12
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    BTW another one
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    Hi Mr PCI,

    I just understand approx 40% of the code, but it looks beautiful!


    Thanks!!

  14. #14
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    Hello AndyJr,

    Right now the code is pasting in Col/Row M1 & N1 of sheet "reports", so, where in the code can i modify in order to paste starting in Col/row M2 & N2 ??
    I see that PCI has already solved your query!

    Regards

  15. #15
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Modify VBA to get rid Duplicated String when Transpose-Index/Score & String associated

    I just understand approx 40% of the code
    It's using Dictionnary ( Dic2) as you did before
    Next code to prepare the list of value without duplicate using Keys

    Please Login or Register  to view this content.
    Next code to clear dictionnary

    Please Login or Register  to view this content.
    Next code to paste Keys
    Please Login or Register  to view this content.

+ 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] String of Text into Box Score Format (Baseball Data)
    By windowshopr in forum Excel General
    Replies: 16
    Last Post: 07-06-2018, 12:44 AM
  2. Replies: 1
    Last Post: 08-07-2015, 04:01 PM
  3. [SOLVED] count duplicated string in Range for each letter,Non Adjacent Row
    By david gonzalez in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-25-2014, 04:00 PM
  4. Replies: 23
    Last Post: 05-19-2014, 09:45 PM
  5. Need to output to serial port if string in column is duplicated.
    By MikeHaras in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-23-2013, 03:45 AM
  6. [SOLVED] Returning Match Score From A String
    By clattenburg cake in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-02-2013, 01:38 PM
  7. [SOLVED] VBA Search for string, modify and re-enter
    By passman86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2013, 10:46 AM

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