Consulting

Results 1 to 6 of 6

Thread: add a sheet (actually one already created)

  1. #1

    add a sheet (actually one already created)

    How can i add a sheet i created (abc.xlm)
    Thisworkbook.sheets.add doesnt have enough method!

    Thank you
    Benjamin

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    Hi Benjamin,

    the code is

    Sheets.Add

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

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  3. #3
    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

  4. #4
    Mac Moderator VBAX Expert shades's Avatar
    Joined
    May 2004
    Location
    Kansas City, USA
    Posts
    638
    Location
    This seems to be an Excel general rather than Mac, so if no one objects I will move this tonight.

    Software: LibreOffice 3.3 on Mac OS X 10.6.5
    (retired Excel 2003 user, 3.28.2008 )
    Humanware: Older than dirt
    --------------------
    old, slow, and confused
    but at least I'm inconsistent!

    Rich

  5. #5
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    268
    Location
    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

  6. #6
    Thank you

    I'll try...

    That is a good one!
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •