Hi, me again...
Thanks for all your help on my last question. I have a new one.. I have a macro where i want it to make a number of pages according to how many I need. I have a button corelating to the macro I want it to run (I am up to 20, 2 pages for each part number) it seems to bog out (Runtime error 1004 Copy Method of worksheet class failed) usually around page 18, the code is exacty the same 'cept for the part number change. Is there anything I can do to stop it from doing that?? Is there a maximun amount of macros allowed to run at one time?
Sub Part3()
'
' Part3 Macro
'
Dim currentFile As String
currentFile = ActiveWorkbook.Name
Application.Run "'" & currentFile & "'!Part2"
Sheets("2-Part").Select
Sheets("2-Part").Copy After:=Sheets("2-Pack")
Sheets("2-Part (2)").Select
Sheets("2-Part (2)").Name = "3-Part"
Sheets("2-Pack").Select
Sheets("2-Pack").Copy After:=Sheets("3-Part")
Sheets("2-Pack (2)").Select
Sheets("2-Pack (2)").Name = "3-Pack"
Sheets("3-Part").Select
Range("E2:H2").Select
ActiveCell.FormulaR1C1 = "=Data!R[7]C[-3]"
Range("E3:H3").Select
ActiveCell.FormulaR1C1 = "=Data!R[6]C[-2]"
Range("E4:H4").Select
ActiveCell.FormulaR1C1 = "=Data!R[5]C[-1]"
Range("H16:I16").Select
ActiveCell.FormulaR1C1 = "=Data!R[-7]C[-3]"
Range("D12:F12").Select
ActiveCell.FormulaR1C1 = "=Data!R[-3]C[2]"
Range("D13:F13").Select
ActiveCell.FormulaR1C1 = "=Data!R[-4]C[4]"
Range("H13:J13").Select
ActiveCell.FormulaR1C1 = "=Data!R[-4]C[1]"
Range("D11:F11").Select
ActiveCell.FormulaR1C1 = "=Data!R[-2]C[3]"
Range("D12:F12").Select
Sheets("3-Pack").Select
Range("B1:C1").Select
ActiveCell.FormulaR1C1 = "='3-Part'!R[1]C[3]"
Range("B2:C2").Select
ActiveCell.FormulaR1C1 = "='3-Part'!R[1]C[3]"
Sheets("Data").Select
End Sub
Bookmarks