+ Reply to Thread
Results 1 to 6 of 6

Macro to duplicate cells with a certain string across columns

  1. #1
    Registered User
    Join Date
    02-24-2017
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    65

    Macro to duplicate cells with a certain string across columns

    Hi Everyone!

    I'm looking for a pretty simple macro that will help me accomplish this task:

    Suppose I have cells that read as follows:

    A1: 345
    A2: 123
    A3: 345
    A4: 456

    I'd like macro that would paste cells containing the string "34" to columns B, C, and D

    So after it is run,

    the file would be as follows:

    A1: 345 B1: 345 C1: 345 D1: 345
    A2: 123
    A3: 345 B1: 345 C1: 345 D1: 345
    A4: 456

    Thanks!

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Macro to duplicate cells with a certain string across columns

    Hello try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,858

    Re: Macro to duplicate cells with a certain string across columns

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Macro to duplicate cells with a certain string across columns

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Macro to duplicate cells with a certain string across columns

    You can take your choice. If 34 is anywhere in the string then
    Please Login or Register  to view this content.
    If 34 is the first two characters of the string then:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-24-2017
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    65

    Re: Macro to duplicate cells with a certain string across columns

    Thanks everyone!

    Got exactly what I needed!

+ 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] Need to combine cells to one string of text if duplicate values exist in multiple cells
    By Chris McGlothen in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-17-2017, 09:13 PM
  2. Replies: 13
    Last Post: 12-01-2016, 05:59 AM
  3. Remove duplicate text from a string in a row of cells
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2013, 08:46 PM
  4. Counting Duplicate cells in multiple columns - pt2
    By dgcuk23 in forum Excel General
    Replies: 2
    Last Post: 03-12-2009, 07:30 PM
  5. Counting Duplicate Cells in different columns
    By SailorGuy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-06-2007, 09:44 AM
  6. finding duplicate cells in different columns?
    By gurj_sandhu in forum Excel General
    Replies: 1
    Last Post: 12-21-2006, 10:53 AM
  7. [SOLVED] How do I recognize duplicate cells in multiple columns?
    By cp mccall in forum Excel General
    Replies: 1
    Last Post: 08-21-2006, 11:35 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