Results 1 to 3 of 3

Copy data from one worksheet to another, and create new worksheets for each data set

Threaded View

  1. #1
    Registered User
    Join Date
    05-27-2010
    Location
    Oklahoma
    MS-Off Ver
    Excel 2003
    Posts
    1

    Talking Copy data from one worksheet to another, and create new worksheets for each data set

    I have two worksheets in one workbook... The worksheet 'data' contains some data that I need to copy and paste into certain cells in another worksheet called 'form'. for each row of data I need a new worksheet created from the 'form' worksheet.

    Basically for each row of data in my 'data' worksheet (321 rows) I need a new worksheet created from my template worksheet 'form'. the data that I need copied from the 'data' worksheet is in cols B-G, and I need this data pasted into the 'Form' worksheet into cells B4 - G4.
    The names of the new worksheets created doesnt matter, i suppose they just have to be unique.

    Also I would like to fill in the date field which is located in column J in my 'data' worksheet and have this pasted into H8 in my 'form' worksheets.

    Also, the rows of data will change daily, it will not always be 321 rows.

    I'm fairly new to VB... So any help would be GREATLY appreciated!

    btw, I am using office 2k3 on Windows 7.

    I tried using this code to create the new worksheets, it worked but, it only creates 254 new worksheets then errors out.

    Option Explicit
    
    Sub Copy_Sheets()
    
    Dim i As Integer
    Dim wks As Worksheet
    
    Set wks = Sheets("data")
    
    For i = 1 to 360
        Sheets("form").Copy After:=Sheets(2)
        ActiveSheet.Name = wks.Cells(i, 2)
        ActiveSheet.Cells(1, 2)=wks.Cells(i, 2)
    Next
    
    End Sub

    Thanks!!

    -Brad
    Last edited by royUK; 05-28-2010 at 01:24 AM.

Thread Information

Users Browsing this Thread

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

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