Worksheet.Copy Expected Function or Variable Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This seems fairly straight forward to me, yet it produces a compile error:
"Expected Function or variable."

Dim oOldSheet As Worksheet
Dim oNewSheet As Worksheet

Set oOldSheet = ActiveSheet

Set oNewSheet = oOldSheet.Copy(oOldSheet)

Any suggestions? Thanks.
 
I'd use:

Dim oOldSheet As Worksheet
Dim oNewSheet As Worksheet

Set oOldSheet = ActiveSheet

oOldSheet.Copy after:=oOldSheet
Set oNewSheet = ActiveSheet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top