ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set sem__ = Sheets("template").Copy(befo=Sheets(1)) (https://www.excelbanter.com/excel-programming/370733-set-sem__-%3D-sheets-template-copy-before-%3Dsheets-1-a.html)

[email protected]

Set sem__ = Sheets("template").Copy(befo=Sheets(1))
 
can someone help me on this one .. i cant figured it why i get error
424



Set sem__ = Sheets("template").Copy(befo=Sheets(1))


ty


Jim Cone

Set sem__ = Sheets("template").Copy(befo=Sheets(1))
 
This works...
Dim sem__ As Excel.Worksheet
Sheets("template").Copy befo=Sheets(1)
Set sem__ = ActiveSheet

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



wrote in message
can someone help me on this one .. i cant figured it why i get error 424

Set sem__ = Sheets("template").Copy(befo=Sheets(1))

ty


NickHK

Set sem__ = Sheets("template").Copy(befo=Sheets(1))
 
If you look at the Copy method of the Sheets collection in the Object
browser, you'll see that it is defined as "Sub Copy([Before], [After])".
As a Sub it has no return value and consequently you have nothing to Set
"sem__" equal to.
If it was a function (e.g. WorkSheets.Add; "Function Add([Before], [After],
[Count], [Type]) As Object") then you could as it return a value, an Object
in this case.

NickHK

wrote in message
oups.com...
can someone help me on this one .. i cant figured it why i get error
424



Set sem__ = Sheets("template").Copy(befo=Sheets(1))


ty





All times are GMT +1. The time now is 07:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com