+ Reply to Thread
Results 1 to 4 of 4

deleting more than one page with macro's

  1. #1
    Ron de Bruin
    Guest

    Re: deleting more than one page with macro's

    Hi

    You can loop through all the sheets in the workbook
    Try this on a copy of your workbook

    You can use
    sh.Cells.Clear (delete also the formating)
    Or
    sh.Cells.ClearContents

    Sub test()
    Dim sh As Worksheet
    For Each sh In ThisWorkbook.Worksheets
    sh.Cells.ClearContents
    Next sh
    End Sub

    Copy this in a normal module

    Alt-F11
    Insert>Module from the menubar
    paste the sub in there
    Alt-Q to go back to Excel

    If you do Alt-F8 you get a list of your macro's
    Select "test" and press Run



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "shrek" <[email protected]> wrote in message news:[email protected]...
    >
    > Ive got a work book with 6 sheets of data in it. Ive worked out how to
    > delete each page indivudally. Im trying to find out how to delete the
    > data in all 6 sheets at once whilst still keeping the template that all
    > the data goes into. I use the assign macro using the tools on excel.
    >
    >
    > Can anyone help or point me in the right direction?
    >
    > Im new to macro's so if a explination in idiot proof mode would be
    > greatly appriciated
    >
    >
    > --
    > shrek




  2. #2
    Ron de Bruin
    Guest

    Re: deleting more than one page with macro's

    Hi

    You can loop through all the sheets in the workbook
    Try this on a copy of your workbook

    You can use
    sh.Cells.Clear (delete also the formating)
    Or
    sh.Cells.ClearContents

    Sub test()
    Dim sh As Worksheet
    For Each sh In ThisWorkbook.Worksheets
    sh.Cells.ClearContents
    Next sh
    End Sub

    Copy this in a normal module

    Alt-F11
    Insert>Module from the menubar
    paste the sub in there
    Alt-Q to go back to Excel

    If you do Alt-F8 you get a list of your macro's
    Select "test" and press Run



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "shrek" <[email protected]> wrote in message news:[email protected]...
    >
    > Ive got a work book with 6 sheets of data in it. Ive worked out how to
    > delete each page indivudally. Im trying to find out how to delete the
    > data in all 6 sheets at once whilst still keeping the template that all
    > the data goes into. I use the assign macro using the tools on excel.
    >
    >
    > Can anyone help or point me in the right direction?
    >
    > Im new to macro's so if a explination in idiot proof mode would be
    > greatly appriciated
    >
    >
    > --
    > shrek




  3. #3
    shrek
    Guest

    deleting more than one page with macro's


    Ive got a work book with 6 sheets of data in it. Ive worked out how to
    delete each page indivudally. Im trying to find out how to delete the
    data in all 6 sheets at once whilst still keeping the template that all
    the data goes into. I use the assign macro using the tools on excel.


    Can anyone help or point me in the right direction?

    Im new to macro's so if a explination in idiot proof mode would be
    greatly appriciated


    --
    shrek

  4. #4
    Ron de Bruin
    Guest

    Re: deleting more than one page with macro's

    Hi

    You can loop through all the sheets in the workbook
    Try this on a copy of your workbook

    You can use
    sh.Cells.Clear (delete also the formating)
    Or
    sh.Cells.ClearContents

    Sub test()
    Dim sh As Worksheet
    For Each sh In ThisWorkbook.Worksheets
    sh.Cells.ClearContents
    Next sh
    End Sub

    Copy this in a normal module

    Alt-F11
    Insert>Module from the menubar
    paste the sub in there
    Alt-Q to go back to Excel

    If you do Alt-F8 you get a list of your macro's
    Select "test" and press Run



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "shrek" <[email protected]> wrote in message news:[email protected]...
    >
    > Ive got a work book with 6 sheets of data in it. Ive worked out how to
    > delete each page indivudally. Im trying to find out how to delete the
    > data in all 6 sheets at once whilst still keeping the template that all
    > the data goes into. I use the assign macro using the tools on excel.
    >
    >
    > Can anyone help or point me in the right direction?
    >
    > Im new to macro's so if a explination in idiot proof mode would be
    > greatly appriciated
    >
    >
    > --
    > shrek




+ 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