+ Reply to Thread
Results 1 to 3 of 3

Creating a new worksheet?

  1. #1
    Registered User
    Join Date
    08-24-2005
    Posts
    26

    Cool Creating a new worksheet?

    Hi,

    Just wondering how I could create a new worksheet from within a macro?

    Cheers

    Sahil

    EDIT: I'd also like to know how to create new workbooks from a macro. and how to name the individual workbooks/worksheets?
    Last edited by schoujar; 08-31-2005 at 01:38 AM. Reason: additional question

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Sheet

    ActiveWorkbook.Sheets.Add Before:=Worksheets(Worksheets.Count)


    Workbook

    Workbooks.Add


    Check VBA help, type ADD, and press F1



    Mangesh

  3. #3
    Patrick Molloy
    Guest

    RE: Creating a new worksheet?

    use a worksheet object for greater control...

    DIM ws as Worksheet
    SET ws = worksheets.add
    with ws
    .Name = "myNewSheet"

    .Range("A1") = format$(Date,"dd-mmm-yy HH:MM")

    end with





    "schoujar" wrote:

    >
    > Hi,
    >
    > Just wondering how I could create a new worksheet from within a macro?
    >
    > Cheers
    >
    > Sahil
    >
    > EDIT: I'd also like to know how to create new workbooks from a macro.
    > and how to name the individual workbooks/worksheets?
    >
    >
    > --
    > schoujar
    > ------------------------------------------------------------------------
    > schoujar's Profile: http://www.excelforum.com/member.php...o&userid=26574
    > View this thread: http://www.excelforum.com/showthread...hreadid=400685
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1