Question : Set Sheets

Ive just started a new project and already run into a problem.
it Fails to compile the Module on "Set shtTotals = shtSummary.Copy(shtSummary)"

What have i done wrong?

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
Sub teamTotals()
Dim shtSummary  As Worksheet
Dim shtTotals   As Worksheet

Set shtSummary = ActiveWorkbook.Sheets("Summary")
Set shtTotals = shtSummary.Copy(shtSummary)
End Sub

Answer : Set Sheets

Copy method of Worksheet object is not a function so cannot be assigned this way.

Try replacing line 6 with this:

shtSummary.Copy shtSummary
Set shtTotals = ActiveSheet
Random Solutions  
 
programming4us programming4us