+ Reply to Thread
Results 1 to 3 of 3

VBA loop copy/paste

  1. #1
    Registered User
    Join Date
    05-15-2008
    Location
    Mt. Vernon, WA
    Posts
    7

    VBA loop copy/paste

    I've spent some time looking for answers online and can't seem to find a resolution to a particular problem.

    I have a spreadsheet and macro that takes info. from a master schedule and creates new tabs for each participant with their specific schedule listed. I execute this by having a "Template" tab which contains a generic form letter than can be individualized for each participant on the master schedule tab (which is already formatted for printing). If you input the participants name in M3, the form will populate with their schedule info.

    Currently, the code is looped to create a new tab for the participant in the top row of the master schedule, copy/paste the template form in the new sheet, and then generate the schedule for that student. Unfortunately, the formatting won't copy over:

    Please Login or Register  to view this content.
    I believe what would work is to: create the newsht; generate the individual schedule on "Template"; copy/paste the schedule to newsht (so that formatting carries over); then copy/paste special (values) the individual schedule on newsht to get rid of the links to the master schedule; erase the name in "Template"; delete row 5 and start with the next row. Unfortunately, I don't know how to write that into the code!

    I appreciate any help and insight into this issue.
    Attached Files Attached Files
    Last edited by barrec; 09-06-2012 at 03:53 PM.

  2. #2
    Forum Contributor
    Join Date
    07-05-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2016
    Posts
    165

    Re: VBA loop copy/paste

    Here is some code you can add to your Module1 just below the End With statement:

    Please Login or Register  to view this content.
    Click on the * icon if this post has been helpful.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,631

    Re: VBA loop copy/paste

    Please Login or Register  to view this content.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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