+ Reply to Thread
Results 1 to 3 of 3

Copy and pasting rows to specified workbooks/sheets based on cell value.

  1. #1
    Registered User
    Join Date
    07-18-2017
    Location
    Dubai
    MS-Off Ver
    2016
    Posts
    7

    Copy and pasting rows to specified workbooks/sheets based on cell value.

    Hello,

    I am working on a problem where I have to write a VBA code to do the following:

    1. Use source file "Sales Data1"
    2. Create new workbooks for each Product Code letter i.e. Workbooks A, B, C
    3. Create new worksheets within each workbook corresponding to each Product Code i.e. Workbook A, Sheets A01 - A045


    4. Copy rows based on Product Code value and paste in the corresponding workbook/worksheet i.e.
    Row containing data for Product Code A01 gets copied to Workbook A, Worksheet A01

    5. Each row copied should be pasted to the next row in the destination sheet.
    6. Close all workbooks except for "VBA Macro" file
    7. Create button within "VBA Macro" file to execute all of the above.

    I've written Steps 1-3 highlighted above. I'm having trouble with the rest.

    Attached folder contains 2 files "Sales Data1" and "VBA Macro"

    Many thanks
    DP
    Attached Files Attached Files
    Last edited by darrenpinto; 12-01-2018 at 02:38 AM. Reason: Problem Solved

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Copy and pasting rows to specified workbooks/sheets based on cell value.

    Hi DP

    Here you go...code is housed in Sales file - no need for a seperate file
    Results after running code attached...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 11-30-2018 at 10:31 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    07-18-2017
    Location
    Dubai
    MS-Off Ver
    2016
    Posts
    7

    Re: Copy and pasting rows to specified workbooks/sheets based on cell value.

    Thank you sintek. Appreciate your help.

    Will go through the code, and let you know if I have any queries.

    Cheers
    DP

+ 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. Copy Multi Rows From Multi Sheets Based On Column Value And Create New Workbooks
    By Huskersippi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2017, 04:51 PM
  2. copy rows between sheets based on a cell value
    By perki307 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2015, 08:53 AM
  3. Copy and Pasting Rows in Excel into a New Sheet based on Cell Value
    By dineshsachidananda in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-27-2014, 10:58 PM
  4. copy and and pasting to first empty cell in different workbooks
    By lwayl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-11-2014, 04:38 PM
  5. Copy rows from one sheet to different sheets based on cell value
    By Ireland316 in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 04-26-2012, 06:17 AM
  6. Copy/pasting values based on a changing day (multiple workbooks)
    By evilgrinners in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-16-2012, 10:05 AM
  7. [SOLVED] Copy rows from all sheets based on cell value
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2005, 10:06 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