+ Reply to Thread
Results 1 to 9 of 9

Macro Insert 12 Rows & Copy Data

  1. #1
    Registered User
    Join Date
    06-21-2015
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    6

    Macro Insert 12 Rows & Copy Data

    Hi All,

    I am an intermediate user of Excel, however, I have never used macro's and I would love to learn but I need assistance to reduce the time spent manipulating data.

    Every Month I get a report as per the below that consists of +/-170 rows.
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA SANPEDRO / EAFCISPY Import 40GE

    I require a macro that inserts 12 rows under each exisitng row and copy the data from the top row into each 11 rows inserted as per the below:
    (I will have 12 Rows reflecting the same data)
    (every month the data varies and the data range varies, it is possible to provide coding for the marco in the form of a button? then I can just copy the data and paste into the template, click the macro button and the macro does the rest.)

    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Import 40RC
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA COTONOU / EAFBJCOO Export 20GE
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Import 20FL
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT
    s.SA ABIDJAN / EAFCIABJ Export 20HT

    I would really appreciate the assisance.

    Regards
    CGreenie

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro Insert 12 Rows & Copy Data

    You need that action to create a summarize sheet for all data (per month)?

    If that is the case there will maybe also other options.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    06-21-2015
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    6

    Re: Macro Insert 12 Rows & Copy Data

    Hi Oeldere

    Correct I need the data for 12 months, however, the 12 months always change.
    It is current month minus 12 months.
    Eg. if we are in June, the data comes from June 2014 to May 2015 (its a rolling 12months).

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Macro Insert 12 Rows & Copy Data

    Probably you get better help, if you add a small excel file, without confidential information.

    Please also add, manualy, the expected result in your file.

    Mark related cells e.g. with the same color (if it is usefull).

    Crosspost
    http://www.mrexcel.com/forum/excel-q...copy-data.html


    See the forumrules
    8. Don't cross-post without a link. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post. Expect cross-posts without a link to be closed.
    Last edited by oeldere; 06-21-2015 at 10:28 AM. Reason: crosspost

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Macro Insert 12 Rows & Copy Data

    This should do what you want.
    I was a bit confused about the desired result, "Insert 12 rows and copy" would result in 13 of each row of the original data, but the example result shows 12 of each. Adjust the Resize(11, 1) in the code below to suit.


    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Registered User
    Join Date
    06-21-2015
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    6

    Re: Macro Insert 12 Rows & Copy Data

    Hi

    I have attached a small version of the report.
    The Tab called raw data is what I receive on a monthly basis.
    The Tab called Final Report is the Data I use to create a Pivot Chart.

    Regarding the Raw data sheet, the Zero's need to be deleted as well.

    At the moment I manually manipulate the data and it takes me 6hours to do the same.
    I cannot afford to waist 6hours on one report.

    I really appreciate your help :-)
    Attached Files Attached Files

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Macro Insert 12 Rows & Copy Data

    Does the routine that I posted work for you?

  8. #8
    Registered User
    Join Date
    06-21-2015
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    6
    Quote Originally Posted by mikerickson View Post
    Does the routine that I posted work for you?

    Thank you for the code, i will be trying the same today amd will provide feedback.

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro Insert 12 Rows & Copy Data

    Another:

    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. Replies: 0
    Last Post: 11-12-2013, 04:56 PM
  2. How to create a macro to insert blank rows and copy data into blank rows?
    By zodiack101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2013, 01:18 PM
  3. Multi functional macro- insert rows, copy data,adding
    By Toun in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2011, 01:19 PM
  4. Replies: 2
    Last Post: 04-21-2011, 07:13 PM
  5. Copy paste data, insert rows, insert data and change . to -
    By xWiZardx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2010, 01:44 AM

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