+ Reply to Thread
Results 1 to 13 of 13

Insert Sheets & Copy

Hybrid View

  1. #1
    Paul Black
    Guest

    Insert Sheets & Copy

    Hi Everyone,

    I have a Sheet Named Master.
    I would like 2 Input Boxes :-

    Input Box 1 will ask me for the Number of Sheets I would like to be
    Inserted.
    Input Box 2 will ask me what the Number of the First New Sheets Tab is
    to be.

    If I was to ask for 50 Sheets to be Inserted and the Number of the
    First Sheet was to be 901 for Example, the 50 Sheets Tabs would go from
    901 to 950.
    I would also like the Number of the Sheets Tab to be Placed in Cell A1
    of EVERY Sheet as a Value.
    Finally I would like the Sheet Named Master to be Copied to EVERY Sheet
    and the Cursor to End Up in Cell B22 of EVERY Sheet.
    It would also be Very Useful if the Sheets to be Inserted are Inserted
    Directly After the Number of the Current Highest Sheet Number Used
    Please.
    I hope I have Explained this Clear Enough.

    Thanks in Advance.
    All the Best.
    Paul


  2. #2
    somethinglikeant
    Guest

    Re: Insert Sheets & Copy

    Paul,

    here is the code I have span for you so far


    Sub SheetInsert()

    x = InputBox("How many sheets would you like to add?", "Insert Sheets")
    y = InputBox("What would you like the number of the first sheet to
    be?", "Insert Sheets")

    For i = 1 To x
    Sheets.Add
    ActiveSheet.Name = i + y - 1
    [A1] = i + y - 1
    ActiveSheet.Move
    After:=Sheets(Worksheets(Worksheets.Count).Name)
    Next i

    End Sub


    the problem i have is knwoing how much of the master sheet you want to
    coy.
    I can't imagine it is everything else this would mean the code that
    writes the sheet name to A1 of each cell is rendered useless. (It will
    be overwritten)

    let me know what range of the Master sheet you want copying and where
    to in each sheet

    somethinglikeant

    http://www.excel-ant.co.uk






    Paul Black wrote:
    > Hi Everyone,
    >
    > I have a Sheet Named Master.
    > I would like 2 Input Boxes :-
    >
    > Input Box 1 will ask me for the Number of Sheets I would like to be
    > Inserted.
    > Input Box 2 will ask me what the Number of the First New Sheets Tab is
    > to be.
    >
    > If I was to ask for 50 Sheets to be Inserted and the Number of the
    > First Sheet was to be 901 for Example, the 50 Sheets Tabs would go from
    > 901 to 950.
    > I would also like the Number of the Sheets Tab to be Placed in Cell A1
    > of EVERY Sheet as a Value.
    > Finally I would like the Sheet Named Master to be Copied to EVERY Sheet
    > and the Cursor to End Up in Cell B22 of EVERY Sheet.
    > It would also be Very Useful if the Sheets to be Inserted are Inserted
    > Directly After the Number of the Current Highest Sheet Number Used
    > Please.
    > I hope I have Explained this Clear Enough.
    >
    > Thanks in Advance.
    > All the Best.
    > Paul



  3. #3
    Paul Black
    Guest

    Re: Insert Sheets & Copy

    Thanks for the Reply somethinglikeant,

    I did want to Copy ALL of the Master Sheet to EACH of the New Sheets (
    Because of Formatting and Column Widths etc ).
    Would it be Easier to do this First and then put the Name of EACH Sheet
    in Cell A1.

    Thanks in Advance.
    All the Best.
    Paul

    somethinglikeant wrote:
    > Paul,
    >
    > here is the code I have span for you so far
    >
    >
    > Sub SheetInsert()
    >
    > x = InputBox("How many sheets would you like to add?", "Insert Sheets")
    > y = InputBox("What would you like the number of the first sheet to
    > be?", "Insert Sheets")
    >
    > For i = 1 To x
    > Sheets.Add
    > ActiveSheet.Name = i + y - 1
    > [A1] = i + y - 1
    > ActiveSheet.Move
    > After:=Sheets(Worksheets(Worksheets.Count).Name)
    > Next i
    >
    > End Sub
    >
    >
    > the problem i have is knwoing how much of the master sheet you want to
    > coy.
    > I can't imagine it is everything else this would mean the code that
    > writes the sheet name to A1 of each cell is rendered useless. (It will
    > be overwritten)
    >
    > let me know what range of the Master sheet you want copying and where
    > to in each sheet
    >
    > somethinglikeant
    >
    > http://www.excel-ant.co.uk
    >
    >
    >
    >
    >
    >
    > Paul Black wrote:
    > > Hi Everyone,
    > >
    > > I have a Sheet Named Master.
    > > I would like 2 Input Boxes :-
    > >
    > > Input Box 1 will ask me for the Number of Sheets I would like to be
    > > Inserted.
    > > Input Box 2 will ask me what the Number of the First New Sheets Tab is
    > > to be.
    > >
    > > If I was to ask for 50 Sheets to be Inserted and the Number of the
    > > First Sheet was to be 901 for Example, the 50 Sheets Tabs would go from
    > > 901 to 950.
    > > I would also like the Number of the Sheets Tab to be Placed in Cell A1
    > > of EVERY Sheet as a Value.
    > > Finally I would like the Sheet Named Master to be Copied to EVERY Sheet
    > > and the Cursor to End Up in Cell B22 of EVERY Sheet.
    > > It would also be Very Useful if the Sheets to be Inserted are Inserted
    > > Directly After the Number of the Current Highest Sheet Number Used
    > > Please.
    > > I hope I have Explained this Clear Enough.
    > >
    > > Thanks in Advance.
    > > All the Best.
    > > Paul



  4. #4
    somethinglikeant
    Guest

    Re: Insert Sheets & Copy

    Yep

    Here you are:-

    Sub SheetInsert()

    x = InputBox("How many sheets would you like to add?", "Insert Sheets")
    y = InputBox("What would you like the number of the first sheet to
    be?", "Insert Sheets")

    For i = 1 To x
    Sheets.Add
    ActiveSheet.Name = i + y - 1
    pasteto = ActiveSheet.Name: Sheets("Master").Cells.Copy
    Sheets(pasteto).[A1]
    [A1] = i + y - 1
    ActiveSheet.Move
    After:=Sheets(Worksheets(Worksheets.Count).Name)
    Next i

    End Sub

    send me an e-mail if you would like me to send the workbook I've been
    working with.
    unless, can you attach workbooks in google groups??

    somethinglikeant

    http://www.excel-ant.co.uk





    Paul Black wrote:
    > Thanks for the Reply somethinglikeant,
    >
    > I did want to Copy ALL of the Master Sheet to EACH of the New Sheets (
    > Because of Formatting and Column Widths etc ).
    > Would it be Easier to do this First and then put the Name of EACH Sheet
    > in Cell A1.
    >
    > Thanks in Advance.
    > All the Best.
    > Paul
    >
    > somethinglikeant wrote:
    > > Paul,
    > >
    > > here is the code I have span for you so far
    > >
    > >
    > > Sub SheetInsert()
    > >
    > > x = InputBox("How many sheets would you like to add?", "Insert Sheets")
    > > y = InputBox("What would you like the number of the first sheet to
    > > be?", "Insert Sheets")
    > >
    > > For i = 1 To x
    > > Sheets.Add
    > > ActiveSheet.Name = i + y - 1
    > > [A1] = i + y - 1
    > > ActiveSheet.Move
    > > After:=Sheets(Worksheets(Worksheets.Count).Name)
    > > Next i
    > >
    > > End Sub
    > >
    > >
    > > the problem i have is knwoing how much of the master sheet you want to
    > > coy.
    > > I can't imagine it is everything else this would mean the code that
    > > writes the sheet name to A1 of each cell is rendered useless. (It will
    > > be overwritten)
    > >
    > > let me know what range of the Master sheet you want copying and where
    > > to in each sheet
    > >
    > > somethinglikeant
    > >
    > > http://www.excel-ant.co.uk
    > >
    > >
    > >
    > >
    > >
    > >
    > > Paul Black wrote:
    > > > Hi Everyone,
    > > >
    > > > I have a Sheet Named Master.
    > > > I would like 2 Input Boxes :-
    > > >
    > > > Input Box 1 will ask me for the Number of Sheets I would like to be
    > > > Inserted.
    > > > Input Box 2 will ask me what the Number of the First New Sheets Tab is
    > > > to be.
    > > >
    > > > If I was to ask for 50 Sheets to be Inserted and the Number of the
    > > > First Sheet was to be 901 for Example, the 50 Sheets Tabs would go from
    > > > 901 to 950.
    > > > I would also like the Number of the Sheets Tab to be Placed in Cell A1
    > > > of EVERY Sheet as a Value.
    > > > Finally I would like the Sheet Named Master to be Copied to EVERY Sheet
    > > > and the Cursor to End Up in Cell B22 of EVERY Sheet.
    > > > It would also be Very Useful if the Sheets to be Inserted are Inserted
    > > > Directly After the Number of the Current Highest Sheet Number Used
    > > > Please.
    > > > I hope I have Explained this Clear Enough.
    > > >
    > > > Thanks in Advance.
    > > > All the Best.
    > > > Paul



  5. #5
    Paul Black
    Guest

    Re: Insert Sheets & Copy

    Thanks somethinglikeant,

    It does Insert & Number the Sheet Tabs and put the Sheet Tab Number in
    Cell A1 of EACH Sheet, but it does NOT Copy & Paste Anything from the
    Sheet Named Master.

    Thanks in Advance.
    All the Best.
    Paul

    somethinglikeant wrote:
    > Yep
    >
    > Here you are:-
    >
    > Sub SheetInsert()
    >
    > x = InputBox("How many sheets would you like to add?", "Insert Sheets")
    > y = InputBox("What would you like the number of the first sheet to
    > be?", "Insert Sheets")
    >
    > For i = 1 To x
    > Sheets.Add
    > ActiveSheet.Name = i + y - 1
    > pasteto = ActiveSheet.Name: Sheets("Master").Cells.Copy
    > Sheets(pasteto).[A1]
    > [A1] = i + y - 1
    > ActiveSheet.Move
    > After:=Sheets(Worksheets(Worksheets.Count).Name)
    > Next i
    >
    > End Sub
    >
    > send me an e-mail if you would like me to send the workbook I've been
    > working with.
    > unless, can you attach workbooks in google groups??
    >
    > somethinglikeant
    >
    > http://www.excel-ant.co.uk
    >
    >
    >
    >
    >
    > Paul Black wrote:
    > > Thanks for the Reply somethinglikeant,
    > >
    > > I did want to Copy ALL of the Master Sheet to EACH of the New Sheets (
    > > Because of Formatting and Column Widths etc ).
    > > Would it be Easier to do this First and then put the Name of EACH Sheet
    > > in Cell A1.
    > >
    > > Thanks in Advance.
    > > All the Best.
    > > Paul
    > >
    > > somethinglikeant wrote:
    > > > Paul,
    > > >
    > > > here is the code I have span for you so far
    > > >
    > > >
    > > > Sub SheetInsert()
    > > >
    > > > x = InputBox("How many sheets would you like to add?", "Insert Sheets")
    > > > y = InputBox("What would you like the number of the first sheet to
    > > > be?", "Insert Sheets")
    > > >
    > > > For i = 1 To x
    > > > Sheets.Add
    > > > ActiveSheet.Name = i + y - 1
    > > > [A1] = i + y - 1
    > > > ActiveSheet.Move
    > > > After:=Sheets(Worksheets(Worksheets.Count).Name)
    > > > Next i
    > > >
    > > > End Sub
    > > >
    > > >
    > > > the problem i have is knwoing how much of the master sheet you want to
    > > > coy.
    > > > I can't imagine it is everything else this would mean the code that
    > > > writes the sheet name to A1 of each cell is rendered useless. (It will
    > > > be overwritten)
    > > >
    > > > let me know what range of the Master sheet you want copying and where
    > > > to in each sheet
    > > >
    > > > somethinglikeant
    > > >
    > > > http://www.excel-ant.co.uk
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > > Paul Black wrote:
    > > > > Hi Everyone,
    > > > >
    > > > > I have a Sheet Named Master.
    > > > > I would like 2 Input Boxes :-
    > > > >
    > > > > Input Box 1 will ask me for the Number of Sheets I would like to be
    > > > > Inserted.
    > > > > Input Box 2 will ask me what the Number of the First New Sheets Tab is
    > > > > to be.
    > > > >
    > > > > If I was to ask for 50 Sheets to be Inserted and the Number of the
    > > > > First Sheet was to be 901 for Example, the 50 Sheets Tabs would go from
    > > > > 901 to 950.
    > > > > I would also like the Number of the Sheets Tab to be Placed in Cell A1
    > > > > of EVERY Sheet as a Value.
    > > > > Finally I would like the Sheet Named Master to be Copied to EVERY Sheet
    > > > > and the Cursor to End Up in Cell B22 of EVERY Sheet.
    > > > > It would also be Very Useful if the Sheets to be Inserted are Inserted
    > > > > Directly After the Number of the Current Highest Sheet Number Used
    > > > > Please.
    > > > > I hope I have Explained this Clear Enough.
    > > > >
    > > > > Thanks in Advance.
    > > > > All the Best.
    > > > > Paul



  6. #6
    somethinglikeant
    Guest

    Re: Insert Sheets & Copy

    Hi Paul


    I have it working on my example.

    can't think what's wrong

    drop me your e-mail address and i'll send this working version


    http://www.excel-ant.co.uk


    Paul Black wrote:
    > Thanks somethinglikeant,
    >
    > It does Insert & Number the Sheet Tabs and put the Sheet Tab Number in
    > Cell A1 of EACH Sheet, but it does NOT Copy & Paste Anything from the
    > Sheet Named Master.
    >
    > Thanks in Advance.
    > All the Best.
    > Paul
    >
    > somethinglikeant wrote:
    > > Yep
    > >
    > > Here you are:-
    > >
    > > Sub SheetInsert()
    > >
    > > x = InputBox("How many sheets would you like to add?", "Insert Sheets")
    > > y = InputBox("What would you like the number of the first sheet to
    > > be?", "Insert Sheets")
    > >
    > > For i = 1 To x
    > > Sheets.Add
    > > ActiveSheet.Name = i + y - 1
    > > pasteto = ActiveSheet.Name: Sheets("Master").Cells.Copy
    > > Sheets(pasteto).[A1]
    > > [A1] = i + y - 1
    > > ActiveSheet.Move
    > > After:=Sheets(Worksheets(Worksheets.Count).Name)
    > > Next i
    > >
    > > End Sub
    > >
    > > send me an e-mail if you would like me to send the workbook I've been
    > > working with.
    > > unless, can you attach workbooks in google groups??
    > >
    > > somethinglikeant
    > >
    > > http://www.excel-ant.co.uk
    > >
    > >
    > >
    > >
    > >
    > > Paul Black wrote:
    > > > Thanks for the Reply somethinglikeant,
    > > >
    > > > I did want to Copy ALL of the Master Sheet to EACH of the New Sheets (
    > > > Because of Formatting and Column Widths etc ).
    > > > Would it be Easier to do this First and then put the Name of EACH Sheet
    > > > in Cell A1.
    > > >
    > > > Thanks in Advance.
    > > > All the Best.
    > > > Paul
    > > >
    > > > somethinglikeant wrote:
    > > > > Paul,
    > > > >
    > > > > here is the code I have span for you so far
    > > > >
    > > > >
    > > > > Sub SheetInsert()
    > > > >
    > > > > x = InputBox("How many sheets would you like to add?", "Insert Sheets")
    > > > > y = InputBox("What would you like the number of the first sheet to
    > > > > be?", "Insert Sheets")
    > > > >
    > > > > For i = 1 To x
    > > > > Sheets.Add
    > > > > ActiveSheet.Name = i + y - 1
    > > > > [A1] = i + y - 1
    > > > > ActiveSheet.Move
    > > > > After:=Sheets(Worksheets(Worksheets.Count).Name)
    > > > > Next i
    > > > >
    > > > > End Sub
    > > > >
    > > > >
    > > > > the problem i have is knwoing how much of the master sheet you want to
    > > > > coy.
    > > > > I can't imagine it is everything else this would mean the code that
    > > > > writes the sheet name to A1 of each cell is rendered useless. (It will
    > > > > be overwritten)
    > > > >
    > > > > let me know what range of the Master sheet you want copying and where
    > > > > to in each sheet
    > > > >
    > > > > somethinglikeant
    > > > >
    > > > > http://www.excel-ant.co.uk
    > > > >
    > > > >
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > Paul Black wrote:
    > > > > > Hi Everyone,
    > > > > >
    > > > > > I have a Sheet Named Master.
    > > > > > I would like 2 Input Boxes :-
    > > > > >
    > > > > > Input Box 1 will ask me for the Number of Sheets I would like to be
    > > > > > Inserted.
    > > > > > Input Box 2 will ask me what the Number of the First New Sheets Tab is
    > > > > > to be.
    > > > > >
    > > > > > If I was to ask for 50 Sheets to be Inserted and the Number of the
    > > > > > First Sheet was to be 901 for Example, the 50 Sheets Tabs would go from
    > > > > > 901 to 950.
    > > > > > I would also like the Number of the Sheets Tab to be Placed in Cell A1
    > > > > > of EVERY Sheet as a Value.
    > > > > > Finally I would like the Sheet Named Master to be Copied to EVERY Sheet
    > > > > > and the Cursor to End Up in Cell B22 of EVERY Sheet.
    > > > > > It would also be Very Useful if the Sheets to be Inserted are Inserted
    > > > > > Directly After the Number of the Current Highest Sheet Number Used
    > > > > > Please.
    > > > > > I hope I have Explained this Clear Enough.
    > > > > >
    > > > > > Thanks in Advance.
    > > > > > All the Best.
    > > > > > Paul



+ 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