+ Reply to Thread
Results 1 to 4 of 4

One line of Data duplicated into multiple lines changing values of some lines

  1. #1
    Registered User
    Join Date
    03-26-2014
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    15

    Unhappy One line of Data duplicated into multiple lines changing values of some lines

    Hi all,

    Struggling with this one, even how to describe it.

    I have a raw data sheet that has lines of data, for this example I have only used 1 "R order number" (Column E) but in reality there could be 50 to 100. Each R Order Number could have several lines in the Raw Data sheet, and the count is based upon "R Line Number" (Column Y). This example has 1,2 and 3.

    On each of those three lines will have subtle differences in several columns which would cause the requirement for a copy of a line to be pasted into the extract sheet and edit Column AM with a new value. These rules are extensive and are included in the workbook. So the three rows can become 10 rows in the extract. The next set of data is appended to the bottom. of the extract list.

    I am at a complete loss. The VBA I have created is creating duplicate from RAW Data to the extract sheet, but then I start struggling with amendment of column AM.

    So for instance

    First rule is if Column AM has a value of "BR", then paste two identical rows in the extract sheet, and in one row put "B" in column AM, and in the other row, put "R" in column AM.

    So if each of my RAW Data rows 1,2 & 3 have BR in AM, then I will need 6 rows.



    Please Login or Register  to view this content.



    Sorry all, I am just struggling with this one. The rules have been handed to me so trying to do my best to explain. Any Help is appreciated.
    Attached Files Attached Files
    Last edited by JBeaucaire; 03-26-2020 at 04:00 PM. Reason: Added required CODE tags as per FORUM RULES, please take a moment to read them (link above in menu bar)

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: One line of Data duplicated into multiple lines changing values of some lines

    This macro meets your "RULES", but the results have a few more rows than your example results, I believe it is because all 3 sample rows have "YES" in column AY.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-26-2014
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: One line of Data duplicated into multiple lines changing values of some lines

    That's great, works brilliantly. However I can't see in the code how it deals with a "BR" and splits them to a B and an R? I can see a B to become back, and R to become Round, but somehow it works for the BR. Sorry just curious so I can learn from this. Its awesome though! Really appreciated

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: One line of Data duplicated into multiple lines changing values of some lines

    We are using INSTR() to check the value of AM for the presence of a "B". So if the value is "B" or "BR", both would be a positive result.

+ 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. Replies: 4
    Last Post: 08-27-2019, 02:40 PM
  2. How to combine data from multiple lines into one line
    By MikeDbes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2016, 04:34 AM
  3. add lines with changing formulas depending on lines in another worksheet
    By fragger224 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2015, 05:15 AM
  4. Multiple lines of similar data to one single line
    By T_Van in forum Excel General
    Replies: 7
    Last Post: 02-27-2012, 06:03 PM
  5. Replies: 0
    Last Post: 02-09-2012, 11:53 AM
  6. Data on multiple lines needs to be put into 1 line
    By DMBeer41 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-22-2011, 11:58 AM
  7. Duplicated lines in a data table
    By kosciosco in forum Excel General
    Replies: 0
    Last Post: 06-08-2006, 12:29 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