+ Reply to Thread
Results 1 to 4 of 4

automate creation of sheets in excel

  1. #1
    JE McGimpsey
    Guest

    Re: automate creation of sheets in excel

    One way:

    This will add one sheet for every 30 items in your master list.

    Assume you master list starts in A2 and extends down without blanks
    intervening.

    Public Sub AddSheetForEach30()
    Dim nNumSheets As Long
    Dim nLastRow As Long
    Dim i As Long

    nLastRow = Range("A" & Rows.Count).End(xlUp).Row - 1
    nNumSheets = Application.Ceiling(nLastRow / 30, 1)
    Do While nNumSheets > 0
    Worksheets.Add Count:=Application.Min(nNumSheets, 256)
    nNumSheets = nNumSheets - 256
    Loop
    End Sub

    In article <#[email protected]>,
    "Daniel" <[email protected]> wrote:

    > automate creation of sheets in excel
    >
    > is there anyway to automate creation of sheets in excel? I would like to
    > have one sheet that has a master list of all items. then a have sheets which
    > are automaticaly generated, 1 sheet for every 30 items on the master sheet.
    > can this be done? is there some vba built into excell that i could use to do
    > this?


  2. #2
    JE McGimpsey
    Guest

    Re: automate creation of sheets in excel

    One way:

    This will add one sheet for every 30 items in your master list.

    Assume you master list starts in A2 and extends down without blanks
    intervening.

    Public Sub AddSheetForEach30()
    Dim nNumSheets As Long
    Dim nLastRow As Long
    Dim i As Long

    nLastRow = Range("A" & Rows.Count).End(xlUp).Row - 1
    nNumSheets = Application.Ceiling(nLastRow / 30, 1)
    Do While nNumSheets > 0
    Worksheets.Add Count:=Application.Min(nNumSheets, 256)
    nNumSheets = nNumSheets - 256
    Loop
    End Sub

    In article <#[email protected]>,
    "Daniel" <[email protected]> wrote:

    > automate creation of sheets in excel
    >
    > is there anyway to automate creation of sheets in excel? I would like to
    > have one sheet that has a master list of all items. then a have sheets which
    > are automaticaly generated, 1 sheet for every 30 items on the master sheet.
    > can this be done? is there some vba built into excell that i could use to do
    > this?


  3. #3
    Daniel
    Guest

    automate creation of sheets in excel

    automate creation of sheets in excel

    is there anyway to automate creation of sheets in excel? I would like to
    have one sheet that has a master list of all items. then a have sheets which
    are automaticaly generated, 1 sheet for every 30 items on the master sheet.
    can this be done? is there some vba built into excell that i could use to do
    this?



  4. #4
    JE McGimpsey
    Guest

    Re: automate creation of sheets in excel

    One way:

    This will add one sheet for every 30 items in your master list.

    Assume you master list starts in A2 and extends down without blanks
    intervening.

    Public Sub AddSheetForEach30()
    Dim nNumSheets As Long
    Dim nLastRow As Long
    Dim i As Long

    nLastRow = Range("A" & Rows.Count).End(xlUp).Row - 1
    nNumSheets = Application.Ceiling(nLastRow / 30, 1)
    Do While nNumSheets > 0
    Worksheets.Add Count:=Application.Min(nNumSheets, 256)
    nNumSheets = nNumSheets - 256
    Loop
    End Sub

    In article <#[email protected]>,
    "Daniel" <[email protected]> wrote:

    > automate creation of sheets in excel
    >
    > is there anyway to automate creation of sheets in excel? I would like to
    > have one sheet that has a master list of all items. then a have sheets which
    > are automaticaly generated, 1 sheet for every 30 items on the master sheet.
    > can this be done? is there some vba built into excell that i could use to do
    > this?


+ 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