PDA

View Full Version : [SOLVED:] add a sheet (actually one already created)



Scrap
03-11-2005, 09:33 AM
How can i add a sheet i created (abc.xlm)
Thisworkbook.sheets.add doesnt have enough method!

Thank you
Benjamin

Paleo
03-11-2005, 09:37 AM
Hi Benjamin,

the code is


Sheets.Add


Can you post your code, then we may check and adapt it.

Scrap
03-11-2005, 09:41 AM
ok , im on it!
2sec


Dim PayeSheet As Worksheet

Set PayeSheet = ThisWorkbook.Sheets.Add
PayeSheet = "P:\Temps_Pr?sence\Mod?le\Paye.xlm"

actually not working, method not accepted


Pretty calm today han:mkay

shades
03-11-2005, 11:03 AM
This seems to be an Excel general rather than Mac, so if no one objects I will move this tonight.

BlueCactus
03-11-2005, 11:28 AM
It's not a Mac issue, but it seems that something like this ought to work for you:


Sub Test()
Dim BookName1 As String
BookName1 = ActiveWorkbook.Name
Workbooks.Open Filename:="your.xls"
ActiveWorkbook.Sheets(index).Cells.Copy
Workbooks(BookName1).Activate
Sheets.Add
ActiveSheet.Paste
End Sub

Scrap
03-11-2005, 12:05 PM
Thank you

I'll try...:thumb

That is a good one! :yes
cheers

Now, i'm on the way to the top with that piece of code.
Thank you Cactus and the others.
Keep helping, it's very appreciate!