Help.. macro to Copy, Paste, create new wksht excel - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Help.. macro to Copy, Paste, create new wksht excel

stpbbystpbby Posts: 1Member
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)

End Sub


Sign In or Register to comment.