+ Reply to Thread
Results 1 to 8 of 8

Macro/VBA to move specific data from one column to another (without duplicates)

  1. #1
    Registered User
    Join Date
    10-28-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Macro/VBA to move specific data from one column to another (without duplicates)

    I'm not sure how to go about creating this Macro so I would really appreciate it if someone could help me. I need a Macro/VBA that moves any word in red from column A into column C as a list.

    However if the same word is highlighted more than once in column A, I only want that word to go into column C once (no duplicates)

    uRpAN.png

    Any help would be appreciated,

    Thanks

    Jeremy

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Macro/VBA to move specific data from one column to another (without duplicates)

    Hi Jeremy
    - are your words always separated by spaces, or are there also other characters ( , ; - )
    - when you say "move", do you want the word deleted from column A as well as added to column C, or do you want to leave A unchanged and copy the reduced text to column B (as your example suggests)?
    cheers
    Nicky

  3. #3
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Macro/VBA to move specific data from one column to another (without duplicates)

    Hi

    try this

    it deletes any red text from used cells in column A and inserts the deleted text into the same row in column C

    it assumes your "red" is pure red ie RGB(255,0,0). If not, you may need to tweak it to refect the shade of red you use.


    Please Login or Register  to view this content.
    if you don't want to delete red text from column A, remove this line:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-28-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro/VBA to move specific data from one column to another (without duplicates)

    Hi NickyC, there are no characters used, just spaces between the words.

    The example (screenshot) doesn't have any text in column C. The red text doesn't need to be deleted from column A, just copied into column C with no empty cells.

    Does that make sense? see screen shot below of the result i would like the macro to achieve

    screenshot2.png

  5. #5
    Registered User
    Join Date
    10-28-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro/VBA to move specific data from one column to another (without duplicates)

    Hi NickyC,

    I've tried the Macro you provided, and it sort of works. See the attached excel spreadsheet. the first tab 'Sheet1' is the result of your Macro, as you can see the are no spaces between the words that have copied over from column A, also there are empty cells between the copied words.

    testmacro.xlsx

    See second tab 'Sheet2' for the result id like to achieve. (column D has the conditions id like the copied words to take into account)

    Your help would be really appreciated.

    Thanks
    Last edited by JezVanderBrown; 10-28-2013 at 08:42 AM. Reason: wrong file attached

  6. #6
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Macro/VBA to move specific data from one column to another (without duplicates)

    Hi Jeremy
    try this instead:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-28-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro/VBA to move specific data from one column to another (without duplicates)

    @NickyC

    Hi NickyC, i've tried running the new Macro you provided (thank you by the way) but nothing seems to happen

  8. #8
    Registered User
    Join Date
    10-28-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro/VBA to move specific data from one column to another (without duplicates)

    Hi NickyC

    Apologies, ignore my last post, it works perfectly! thank you so much for your help I really do appreciate it!

+ 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] Trying to move specific range to a specific sheet based on data in certain column
    By cain2011 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-01-2013, 08:09 AM
  2. Macro that searches through column and removes specific duplicates
    By bruizer31 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-17-2013, 02:39 PM
  3. Replies: 2
    Last Post: 12-21-2012, 12:42 AM
  4. Need macro for duplicates of specific cells in one column
    By brandanhadlock in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-07-2012, 10:27 AM
  5. Replies: 2
    Last Post: 03-13-2006, 01:10 PM

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