ANBgrafix
06-14-2008, 03:05 PM
IS THERE A WAY TO COPY THE CUURRENT SHEET TO A NEW SHEET AT THE END OF A WORKBOOK AND HAVE IT AUTOMATICALLY COPY THE VALUES OF 2 CELLS IN THE PREVIOUS SHEET AND PASTE THEM IN 2 DIFFERENT CELLS IN THE NEW WORKSHEET.
The Macro below was recored to give you an idea of what i was trying to do.
1 "Totals" is the first sheet in the workbook.
2 "Totals (2)" is the newly copied worksheet.
Sub SheetCopy()
' SheetCopy Macro
' Copy the active sheet to the end of a workbook then while the copied
' sheet is active copy the values of B29:C29 and paste the values to new
' sheet B2:C2
'copy to sheet2
Sheets("Totals").Select
Sheets("Totals").Copy After:=Sheets(1)
Range("B2").Select
ActiveCell.FormulaR1C1 = "=SUM(Totals!R[27]C+1)"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=SUM(Totals!R[27]C+1)"
Range("C3").Select
'copy to sheet 3
Sheets("Totals (2)").Select
Sheets("Totals (2)").Copy After:=Sheets(2)
Range("B2").Select
ActiveCell.FormulaR1C1 = "=SUM('Totals (2)'!R[27]C+1)"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=SUM('Totals (2)'!R[27]C+1)"
Range("C3").Select
End Sub
THANX IN ADVANCE!
ANB
The Macro below was recored to give you an idea of what i was trying to do.
1 "Totals" is the first sheet in the workbook.
2 "Totals (2)" is the newly copied worksheet.
Sub SheetCopy()
' SheetCopy Macro
' Copy the active sheet to the end of a workbook then while the copied
' sheet is active copy the values of B29:C29 and paste the values to new
' sheet B2:C2
'copy to sheet2
Sheets("Totals").Select
Sheets("Totals").Copy After:=Sheets(1)
Range("B2").Select
ActiveCell.FormulaR1C1 = "=SUM(Totals!R[27]C+1)"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=SUM(Totals!R[27]C+1)"
Range("C3").Select
'copy to sheet 3
Sheets("Totals (2)").Select
Sheets("Totals (2)").Copy After:=Sheets(2)
Range("B2").Select
ActiveCell.FormulaR1C1 = "=SUM('Totals (2)'!R[27]C+1)"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=SUM('Totals (2)'!R[27]C+1)"
Range("C3").Select
End Sub
THANX IN ADVANCE!
ANB