Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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)
Next

End Sub


Thanks!!

-Brad
Sign In or Register to comment.