Create & Name Worksheets Based On Names From Table

Mar 28, 2008

I'm trying to create a macro which will run through every salesperson in a list, and copy and paste their product and client data (from separate sheets) to a template sheet. The template sheet will then by copied to the Salesgroup workbook, and renamed to the salesperson's name. Then the macro should go back to the original workbook and do it all again for the next salesperson, putting them into the same workbook.

The problem I'm having is that the references to the Template worksheet seem to be being messed up by copying the template sheet to the new workbook, and it then ends up creating all the worksheets, but it stops taking the data from the data sheets, and ends up copying the previous worksheet and pasting that into the new copied template, which means that I get the template multiple times across the same sheet.

Sub SalesSheets()
Dim Salesbook As Workbook
Dim NewBook As Workbook
Dim SalesDataSheet As Worksheet
Dim ClientDataSheet As Worksheet
Dim SalespersonListSheet As Worksheet
Dim Template As Worksheet
Dim rRange As Range
Dim rCell As Range
Dim strText As String
Dim SalesGroup As String
Application.DisplayAlerts = False
Application. ScreenUpdating = False
Set Salesbook = Application.Workbooks("2008 Salesperson TEST.xls") 'change filename here
Set Template = Salesbook.Worksheets("Salesperson Template")
Set SalesDataSheet = Salesbook.Worksheets("SP product YoY")
Set ClientDataSheet = Salesbook.Worksheets("Client YoY")
Set SalespersonListSheet = Salesbook.Worksheets("Salesperson List")..........................

View 3 Replies


ADVERTISEMENT

Automatically Create New Worksheets Based Upon List Of Names

Aug 10, 2014

I have a list of names in column A, and want to automatically create worksheets within this same workbook based on the list.

List of values:
Dairy NI
Dairy SI
Sheep and Beef
Equine
Sports Turf
Water Industry
Horticulture Services
Production Horticulture
Other Agriculture

Therefore, a macro or coding to automatically create 9 spreadsheets named as per this list.... My list is approximately 50+ hence inquiring if there is an easier way!

View 1 Replies View Related

Create Ranking Table With Names

Apr 10, 2008

I have an excel ranking 8 participants in a tournament.

In the excel you can see the people participating and there cumulative score next to their name.

What i want to do now is create a table that reads:

Cell A Cell B

1st place "name of individual with minimum points"
2nd place "name of individual with min points, from the leftover people"
""
8th place

I have used vlookup function, but I can either get it only to display first place individual but not the rest, sometimes it wont work because values of peoples scores have to be in ascending order.

View 3 Replies View Related

Excel 2010 :: Create Master List Worksheet From Lists Of Names On Several Worksheets

Jun 6, 2013

I'm using Excel 2010. I have a workbook that has six or seven worksheets in it. Each worksheet has a header row, and then lists of clients at the clinic where I work. The columns are last name, first name, medicaid #, social security #, DOB. We use these lists every month to verify that each client has Medicaid for the month. Therefore, there are also columns with names like April, May, June where we mark yes or no for each client. Some of the worksheets also have information about the clients' guardian, phone number, etc., but not every worksheet has those. (I can't show you the worksheets b/c of federal privacy laws, of course.)

I really, really want a worksheet that's a master list of the data from each of the existing worksheets, and I'd like to keep it synced to the source worksheets. I'd love it if I could also add a column telling me which of the source worksheets the data originally came from.

I've tried a few things to make it happen, but nothing has worked.

I've tried using the Consolidate function built into Excel as well, but that only works with numbers, not text, and it wants to manipulate the numbers instead of just copying them over.

I've found several macros online that should have worked (including one from this site) but that I wasn't able to install to my worksheet. I followed all the steps for installation, and throught it worked, but when I went back to the Excel file to run the macro, the list of available macros remained emptpy.

Is it possible that corporate IT has disabled the ability to install macros? Is there somewhere in Options were I need to go to turn Macros on?

View 5 Replies View Related

Create Workbooks & Worksheets For Each Group In Table

Jan 17, 2008

I have a workbook that contains one worksheet with data. This data has 7 columns and is a database metadata report.

The columns are as follows:

Table
Joined Tables
Column Name
Column Alias
Column Description
Column Data Type
Column Length

From this data, I am looking to have a script that automates the creation of a new workbook for each unique value in the Table column (i.e. tablename.xls) and saves them to my local drive. Each workbook then would have x number of worksheets named joined table 1, joined table 2, etc that relate to the name of the table in the original Table column. Finally, each worksheet will contain the related Column data for each Joined Table as mentioned above.

View 9 Replies View Related

Create Range Names Based On Corresponding Cells

Aug 5, 2008

I want to make several charts with dynamic ranges. To do that, I wrote the offset functions I need in cells. I've attached a sample spreadsheet. I want to have a macro so that when I run it, it will take the contents of the active cell, insert a name called those contents, and make it refer to the cell 4 to the left of it.

In the spreadsheet, I'd like to be able to click on E2 (sentdate1), create a name called sentdate1, and make its value A2, or =OFFSET('Sentiment'!$A$3,0,0,COUNT('Sentiment'!$A:$A),1). Here's what I have so far.

Sub Macro8()
ActiveCell.Offset(0, -4).Range("A1").Select
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveWorkbook.Names.Add Name:="sentdate1", RefersToR1C1:= _
"=OFFSET(Sentiment!R3C1,0,0,COUNT(Sentiment!C1),1)"
End Sub

Auto Merged Post Until 24 Hrs Passes;Here's the sample worksheet.

View 6 Replies View Related

Create Command Buttons Based On Worksheet Names

Jan 18, 2010

I am at it again and maybe I am asking to do something that is not possible. I am trying to build a program that will allow the user some flexibilty down the road if I am no longer here to support my code. I have a workbook that contains several sheets. The sheets are labled by equipment name. The Sheets themselves contain specific data with regards to the equipment. What I want to do is as follows. Populate a user form with command buttons based off of the worksheet names. The reason for this would be if 2 years from now we add a new piece of equipment all the user will have to do is add a sheet in the workbook and the user form would reflect the new sheet with a new button. Like wise if I delete a sheet in the workbook the user form would refelect that change as well.

View 14 Replies View Related

Create Multiple Workbooks With Names Based On List

Sep 2, 2007

I have some very tedious work to do in Excel:

table looks like following:
DepID name function
S1 a YY
S1 b XX
S1 c ww
S2 d oo
S3 e ii
S3 f ll
S4 t mm
. . . . . .. . . .
. . . . . .. . . .
. . . . . .. . . .

S7999 u ee
S7999 w aa

My task is to create new folders for each department according to DepID, which means if there are 7999 departments, I have to create 7999 folders, any VBA code can do this?

View 9 Replies View Related

Create Individual Worksheets For Each Related Group Of Table Range

May 25, 2008

I have a huge worksheet containing Blackberries expenses of my company divided by multiple sections. Each section follows the following pattern: Example:

Client 222-5555 MY COMPANY NAME LCC
International Calls
- Call to Bahamas on June - $50,00
Local Calls
- Call to NY on June - $ 30,00
Total Price - 80,00

I would like to select each row between client and total price and paste then on multiple sheets in order to create individual invoices. The selection must be based on the client number (for instance 222-5555) that is part of the cell value.

View 4 Replies View Related

How To Populate Table With Names Based On Cell Numbers

Mar 13, 2014

I have a column (A) with names, Column (B) with platoon numbers. On another sheet I have a table for each platoon and I want it to be populated with the names of each platoon indevidually. The names are alphabetically and the platoon numbers are mixed.

Column A Column B
Name Platoon
J Goodman 1
L Barns 7
H Law 1
B Aims 10

and so on....

I want all the names from platoon 1 to appear in the table for platoon 1. I have about 3000 members and 40 platoons.

View 3 Replies View Related

Create New Worksheets Based On Range On Other Worksheet

Dec 21, 2011

I have file contains two worksheets. 1st worksheet named "list" and the 2nd one named "Template". I have a range in WS "List" let say a1:d20 that contains names. This range is not fix, it might be more or less. I need creating new worksheet using worksheet "Template" for the new sheets in the mentioned range as follow:

"Create new worksheet for each name in this range."

List is not unique, some names are duplicated. If the name repeated, create only one. Use worksheet template for each new worksheet created.

View 2 Replies View Related

Create Individual Worksheets From Data Based On Conditions

Sep 15, 2009

I’ve created a spreadsheet to record all transactions ( Sheet 1) at a train auction for members only (Sheet 2). Currently, the workbook I created will ‘manually’ create receipts for any buyers/sellers by filling in Member's name in Sheet 1 and then selecting ‘View ‘Member’ Receipt’ button.

Ideally, I would like a macro that will automatically generate a worksheet for any member that has sold or bought an item at the auction and insert worksheets between ‘Start’ & ‘End’ tabs (with option to refresh data) in location order (A-D). Because members come from near and far we would like to generate the members that need to travel the farthest first. Is it possible to create a receipt for only the members that have transactions?

View 4 Replies View Related

Create Worksheets Based On Data Groups In Column

Apr 10, 2008

I have a workbook that lists system analysts and information on the systems they're responsible for. I would like to have an Excel macro that will:

1. Create and name a new worksheet for each UNIQUE value in the 'Name' column (new worksheet for each analyst)
2. Copy their system info to each respective worksheet

I've attached a sample workbook.

View 2 Replies View Related

Excel 2010 :: Extract List Of Names From Table Based On Two Criteria?

Mar 3, 2013

I'm trying to extract a list of names from an Excel 2010 table based on two criteria, thus:

=IFERROR(INDEX(Database[FullName],AGGREGATE(15,6,ROWS(Database[Age]-ROW('Database'!$A$2))/((Database[Age]>1.8)*(Database[Age]

View 4 Replies View Related

Create Dropdown That Will List All Names Starting With Initial Letter Of Names?

Jan 13, 2014

I have a long customer listing, names 5 to 36 characters and several with their location in the name as well as a few common duplicate names. I am trying to produce sheet where the customers name once selected opens in the customers spreadsheet and data can be added/amended for sales etc.The lists are not in alphabetical order as when created a customer number is automatically allocated. My aim is just to type in the first letter of the name and the dropdown appears the customer is selected and their card appears. I have tried data validation, lookup, vlookup, Dropdown and Match/find. they only return the first record found and no sign of any others. Find returned all instances of the letter appearing in every name.

View 9 Replies View Related

Can Create Data Validation List Of Names Created In Name Box Or Sheet Tab Names

May 7, 2012

Can I create data validation list of the names created in the name box or of the sheet tab names?

View 5 Replies View Related

Create Array Of File Names/sheet Names

May 1, 2008

Two part question:

1) I'm relatively new to arrays, but what I need to do is generate a list of file names and the sheets within each one. I would like to use an array for this, but since I don't have much experience.... well....that's why I'm here. Can someone point me in the right direction?

2) And the second part of this.... I was planning on using the FileSystemObject to determine the files in a selected folder and loop through that list of files, opening each one and harvesting the required info (file name and all sheet names). Should I use the FSO or is there something built into Excel that might be better (and also limit the number of dependencies for this little "project" of mine).

View 9 Replies View Related

Create Table Of All Possible Combinations Based On 4 Values

Mar 6, 2012

I'm trying to create a table of all possible combinations based on 4 values (8,4,2,-2) into 6 columns. An example is below of what the table should look like

Field 1Field 2Field 3Field 4Field 5Field 688888888888488884488844488444484444488888288882288822288222282222222222288888-244-2-2-2-2444444884422

View 7 Replies View Related

Create Unique Table Based On Criteria

Aug 31, 2007

Our reservation system exports a spreasheet daily which contains hundreds of records relating to bookings. The worksheet has an ID column which is not unique, but is sorted alphabetically. I need to write some code to delete all records below the first 'set' of records relating to the first ID value found. i.e. i want to end up with only the set of records relating to the first ID found. So the basic logic would be to look at the value of the field in the ID column of the first record and then iterate down the rows until it came to a different value and then delete all rows below that. Its simple in concept, but im stuck on how to write this.

View 9 Replies View Related

Create Pivot Table Based On Union Query

Jul 2, 2010

I created a union query in Access to join two tables (Projections and Actual Sales). The query produces the results I want. I need to create a pivot table in Excel using the union query as the source. When I pull up the data import function in Excel, the union query does not appear. Do I need to do something else? I have tried to create a select query where I select all from the union query and I can find that fine.

When I use this query to create the pivot table the results end up all zeros when I try to sum the values. It creates some crazy results when I show it as count of also.

I can provide the data in either the Access database or Excel spreadsheet.

View 4 Replies View Related

Create Autofilter Using Validation Based On Table In Another Worksheet?

Feb 25, 2013

Can I validate data based on a list in another workbook? is what I mean to say.

View 2 Replies View Related

Create Pivot Table Based On Access Recordset

Nov 1, 2008

I'm looking for an example of creating a pivot table based on an ADO Access Recordset.

I understand I can use MS Query - which I am, but looking to see if an alternative exists. A table I am inetrested in currently has 400,000 records I would like to retrieve and pivot.

View 9 Replies View Related

Table Names Revert To Cell Names When File Is Reopened

Jan 4, 2013

I have a worksheet with many tables that I use in formulas.

I like tables for a couple reasons, one being the ability to insert/delete rows without affecting the rest of that worksheet row.

Also, automatic copy of formulas/formatting is great.

But, what I really like about tables is the ability to use the naming conventions in formulas.

Problem is when I save this worksheet, after I close it and open it back up, all table references in my formulas have been converted to cell references.

Example:

Code:

=IF((SUMIF('Quote 1'!$M$28:$M$43,">"&'Quote 1'!$J$57:$J$60)*'Quote 1'!$G$57:$G$60)+(COUNTIF('Quote 1'!$M$28:$M$43,""&'Quote 1'!$J$57:$J$60)*'Quote 1'!$G$57:$G$60)+(COUNTIF('Quote 1'!$M$28:$M$43,""&tblOSSRV[Min Order Cost])*tblOSSRV[Cost / Part])+(COUNTIF(tblFam[[#Data],[Qty by Factor2]],""&tblOSSRV[Min Parts Per Line])*tblOSSRV[Cost / Part])+(COUNTIF(tblFam[[#Data],[Qty by Factor2]],"

View 4 Replies View Related

How To Create Calculated Field Based Off Two Avg Fields In Pivot Table

Feb 12, 2014

I have a Pivot table that pulls the Avg of two fields for two months, see example below.

Avg Gross $ Avg Net $
Jan 2014 20 10
Feb 2014 30 20

sample 1.png
See sample attached.

The Avg Gross and Net is shown by going into the values and selecting "Summarized value by -> Average".

On the right side of this Pivot, what I wanted to do is to show a Avg Gross to Net $ in this pivot. So the formula should take "Avg Gross $" - "Avg Net $" = Avg Gross to Net $.

I am having trouble calculting this new field in the pivot table using a calculated field because the Calculated field pulls the variables from the existing field list and there isn't a field called "Avg Gross/Net"....I need to find a way to calculate the Avg Gross to Net into the Pivot table so I can pull a pivot graph out of it.

View 3 Replies View Related

Macro To Split Table Of RawData Into Individual Worksheets Based On Column C Value?

Jun 19, 2014

I am trying to divide a table of data (7 Columns, 500-1000'ish rows) into individual worksheets based on any unique values in column. There may be anywhere from 10-30 instances of the same value in Column C, and I need to bring all rows of each unique instance into a newly created worksheet to be labelled the same as the value in Column C.

The RAW data will be updated monthly by keeping a template file copying and pasting data, therefore I am hoping to have a "SORT" button with this Macro assigned to it. I have quickly thrown together a sample workbook with how the RAW DATA will be pasted into the file, with additional sheets showing how I would like the data split and organised.

View 2 Replies View Related

Macro Code Create Pivot Table Based On Dynamic Source Data

Nov 28, 2006

The "Sum" sheet can change its number of rows. The pivot table is based on it. I'm having trouble with the SourceData portion of the code in my macro ....

View 9 Replies View Related

Create A List Of Unique Names From A List Of Multiple Names

Oct 21, 2009

I have a database output file where one of the columns contains managers names, often more than once. I want to apply an autofilter on manager name and then copy the result to another sheet or sheets. My criteria for the autofilter is a variable pointing to a list of names that at present I maintain by hand; a for-each-next loop then cycles through the names.

What I would like to do, before running the autofilter code, is to create the list of names via code. This would then automatically pickup names that are missing.

The code I have so far is below:

Public Sub find_managers()
Dim managers1 As Range
Dim names1 As Range
Dim n1 As Variant
Dim n2 As Variant

In my mind it should check the names in the unique list against the imported list and add any missing names.

View 9 Replies View Related

Combining Names From Two Different Worksheets?

Jan 21, 2014

I have two worksheets...let's call them worksheet A and worksheet B. How can I get a list of people who are on worksheet A AND also on worksheet B? I would actually like those names on a separate worksheet.

View 6 Replies View Related

Run Code On Worksheets With Certain Tab Names

Aug 11, 2007

My Thread title should have read covert code TO run on all worksheets with same word in Name. I have had a look at some other pieces of code in this forum but they are quite the same as I want to do....I have tried a few things but each time I get an error ...so for sure I am not modifying the code quite right, I ahve been missing something for what I now want it to do. So I wonder if someone could Please review these two pieces of code...they of course are both for running on just one worksheet in a wookbook.

I would like them both be able to run, still as tow separete pieces of code as they are, on all and only worksheets that have in their worksheet name a key word in this case the word "Region" and that those worksheets all in a single workbook but the workbook does have other worksheets in it I dont want the code to run one on - but those worksheets do not have in their worksheet name the word "Region".

Sub test()
Dim r As Range, txt As String, ws1 As Worksheet, i As Long
Set ws1 = Sheets(1)
With CreateObject("Scripting.Dictionary")
.CompareMode = vbTextCompare
For i = 16 To 21
Again:
For Each r In ws1.Range(ws1.Cells(6, i), ws1.Cells(Rows.Count, i).End(xlUp))
If r.Value <> "" Then
If Not .exists(r.Value) Then
.Add r.Value, Nothing
Else
txt = txt & "," & r.Address(0, 0)
If Len(txt) > 245 Then
ws1.Range(Mid$(txt, 2)).EntireRow.Delete
txt = "": .RemoveAll: Goto Again
End If .............

View 9 Replies View Related

Using VBA To Create Defined Names?

Jan 13, 2013

Ive created the following code which I want to use to create a name in excel but it doesnt work.

when i put =INDIRECT i get an error and with out the = it places a text string in with speech marks on it e.g. defined name reference in excel reads ="INDIRECT('Health and Safety'!$AP$3)"

How do I get rid of those speech marks? the cell reference will change each time the macro runs and so will the sheet reference.

myC = ActiveCell.Address
Dim strNAME As String
strNAME = "YAXIS" & "_" & "HS" & Chartnumber
strSHEET = ActiveSheet.Name
ActiveWorkbook.Worksheets(ActiveSheet.Name).Names.Add Name:=strNAME, _
RefersToR1C1:="INDIRECT('" & strSHEET & "'!" & myC & ")"

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved