Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Worksheet.Copy Expected Function or Variable Error

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Worksheet.Copy Expected Function or Variable Error

I'd use:

Dim oOldSheet As Worksheet
Dim oNewSheet As Worksheet

Set oOldSheet = ActiveSheet

oOldSheet.Copy after:=oOldSheet
Set oNewSheet = ActiveSheet



Lazzaroni wrote:

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.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Variable Range to New Worksheet nospaminlich Excel Programming 3 August 3rd 07 01:20 AM
Compile Error: Expected Variable or Procedure, Not Project BEEJAY Excel Programming 7 November 6th 06 08:40 PM
compile error: Expected: = ...Why? cesw[_2_] Excel Programming 3 September 10th 05 12:41 AM
how do i use the function to copy and paste a determined variable. Strem Excel Worksheet Functions 2 January 8th 05 05:31 PM
compile error: expected variable or function MMM Excel Discussion (Misc queries) 3 December 24th 04 03:11 PM


All times are GMT +1. The time now is 03:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"