looking for an excel solution to create a new sheet at the end based on the contents of a template sheet within the same workbook.
looking for an excel solution to create a new sheet at the end based on the contents of a template sheet within the same workbook.
One way: Worksheets("template").Copy _ after:=Worksheets(Worksheets.Count) -- Dave Peterson
1.new sheet created 'on the fly' from template in same workbook
Thankyou Dave Could you help with another question? I am very new to excel and am trying to build a tool to help me define tasks in my work day schedule. Now I can create a new sheet 'on the fly' How would I copy the contents of a cell in an existing sheet to a cell on the new sheet; and How would i rename the new sheet based on cell contents? MrT "Dave Peterson" wrote: > One way: > > Worksheets("template").Copy _ > after:=Worksheets(Worksheets.Count) > > > > > > MrT wrote: > > > > looking for an excel solution to create a new sheet at the end based on the > > contents of a template sheet within the same workbook. > > -- > > Dave Peterson >
2.Create a new sheet in a workbook from a template
In my last question I was looking for a way to check or uncheck a tick box to insert or remove a new sheet in a workbook. I know I can create a new workbook based on an excel template file, can I combine these two steps and set the macro below to create a new worksheet, based on a template, in the existing workbook? Previous macro was Public Sub CheckBox1_Click() Const sSHEETNAME As String = "My New Sheet" On Error Resume Next With ActiveSheet If .CheckBoxes(Application.Caller).Value = xlOn Then With Worksheets.Add(After:=Sheets(Sheets.Count)) .Name = sSHEETNAME .Range("A1").Value = "Related Text" End With .Select 'Restore selection to calling sheet Else Application.DisplayAlerts = False Worksheets(sSHEETNAME).Delete Application.DisplayAlerts = True End If End With On Error GoTo 0 End Sub -- Roger W
3.Create new sheets based off Data sheet, and template sheet
I currently have a database which includes 6 columns and several thousand rows. I have created a template for this data to be input into, and I have been manually typing the data, and copying the template, renaming it, adding data, then the process starts all over. I have found the following code which takes the first column of my data, and creates a new worksheet (copied from template) then changes the WS name to the data in the first column. Public Sub CopyData() ' Determine how many CBS CODES are on Data Sheet FinalRow = Range("A65000").End(xlUp).Row 'Loop through each CBS CODE on the data sheet For x = 1 To FinalRow LastSheet = Sheets.Count Sheets("DATA").Select CBS = Range("A" & x).Value 'Make a copy of TEMPLATE and move to end Sheets("TEMPLATE").Copy After:=Sheets(LastSheet) 'Rename the Sheet Sheets(LastSheet + 1).Name = CBS Next x End Sub I would also like to place the other data in the row in it's appropriate spot in the new worksheet. Being new to macros and vba, I am finding it difficult to create a macro that will actually do this for me. Here is an example of my current spreadsheet... A B C D E F 1 177.2.2 PC 10C.01 EXCAVATE 21,536.00 21,536.00 CY 2 177.2.3 PC 10C.02 RAMPS 67,804.00 67,804.00 SY A1 - Becomes the Spreadsheet name B1 - Becomes Bid Item in Cell D11 of Sheet 177.2.2 C1 - Becomes Description in Cell H11 of Sheet 177.2.2 D1 - Becomes Forecast Qty in Cell Y11 of Sheet 177.2.2 E1 - Becomes Owner Qty in Cell AE11 of Sheet 177.2.2 F1 - Becomes Unit of measure in Cell AI11 of Sheet 177.2.2 Row 2 then creates a New sheet called 177.2.3 and the process starts all over. I have approx 3000 items that need sheets generated, so you can see why I am looking for an easier solution. Thank you so much in advance! Ryan
4.Create a new workbook for all Unique values and new work sheets to that new workboks
I'm new to VBA and needs to achieve the following task: I've got a workbook with one worksheet with more then 1000 rows of data with 185 columns. There multiple Territory Reps in column E and one/multiple Retailer on column B. There are one/multiple retailers for each Territory Rep. I need to create new workbook for each unique Territory_Rep and one/ multiple worksheets on this new workbook. Finally I抣l have 5 workbooks for Territory Reps and each workbook will have multiple worksheets for each Retailer that belongs to the Territory Rep. Each sheet will have calculated figures that would derived from column Sales1 and Sales2. Data looks as bellow: Category Retailer_No Retailer_Name Status Territory_Rep Sales1 Sales2 Cat1 1 Ret 1 Acti Rep 1 100 300 Cat1 9 Ret 2 Acti Rep 2 300 100 Cat1 7 Ret 3 Acti Rep 1 400 200 Cat1 4 Ret 4 Acti Rep 4 100 100 Cat1 5 Ret 5 Acti Rep 3 200 500 Cat1 10 Ret 10 Acti Rep 3 300 100 Cat1 11 Ret 11 Acti Rep 1 600 200 Cat2 6 Ret 6 Acti Rep 2 800 700 Cat2 2 Ret 7 Acti Rep 5 500 500 Sort the table by Territory Rep as below: Category Retailer_No Retailer_Name Status Territory_Rep Sales1 Sales2 Cat1 1 Ret 1 Acti Rep 1 100 300 Cat1 7 Ret 3 Acti Rep 1 400 200 Cat1 11 Ret 11 Acti Rep 1 600 200 Cat1 9 Ret 2 Acti Rep 2 300 100 Cat2 6 Ret 6 Acti Rep 2 800 700 Cat1 5 Ret 5 Acti Rep 3 200 500 Cat1 10 Ret 10 Acti Rep 3 300 100 Cat1 4 Ret 4 Acti Rep 4 100 100 Cat2 2 Ret 7 Acti Rep 5 500 500 Then create: Workbook "Rep 1 13-02-2008.xls" Worksheets "Ret 1", "Ret 3", and "Ret 11" On each sheet insert a calculated value from the main sheet e.g. Sales1 + Sales2 Workbook "Rep 2 13-02-2008.xls" Worksheets "Ret 2" and "Ret 6" Workbook "Rep 3 13-02-2008.xls" Create Worksheets named: "Ret 5" and "Ret 10" Workbook 4 = "Rep 4 13-02-2008.xls" Worksheets named: "Ret 4" and "Ret 8" Workbook 5 = "Rep 3 13-02-2008.xls" Worksheet named: "Ret 7" Nazmul Thanks in advance
5.Consolidate multiple workbooks (...and adding new files in the master workbook on the fly)
Hi There, I am looking for a solution that can combine multiple work books in to one workbook and adding additional files in the master workbook on the fly. We are a marketing team that are working with a budget file per product. The number of products are increasing throughout the year, Therefore I would like the master file to gather all the data from a specified file and I would like the file to look in to the folder to see if new files have been added and if so add the data to the master file, The data is always placed in the same way in the document. FILENAME.xlsx --> Budgets --> A20:E35. I would also like to have the file name as well to identify the data in the master sheet. My excel wizard colleague tells me that this isn't possible in excel, but it must be with some kind of VBA solution? I know some very basic VBA but I would never be good enough to write the code snippet my self. Any words of advice? Solutions? /S
6. Making a macro on a template update with new each new sheet create
Users browsing this forum: No registered users and 88 guest