Macro To Extract Tickers / Pivot Table
Oct 2, 2009
I need to manipulate some data in order to make it reasonable. I'm reading up on Macro's now in order to be able to do this stuff in the future, but I think macro's are a long term thing.
Actually before I go into that, is there any book one can recommend for macro's? I do have a friend's books, How to Do Everything with MS Office Excel 2003, MS Excel Bible 2003, and MS Office - Excel 2003 Formulas. Are these good or any other recommendations? In particular I would like some data to play around w/ so that when in the book they tel me to do something I actually have some data to manipulate. I imagine learning the basics of macro's will be easy enough, but as I understand it the real power of macro's comes from programming in VB, and I dont see how that can be covered in these books.
Now for the more specific questions -
My raw data looks like the attached excel file called Raw Data, I want it to end up as the other attached excel file called Result. How would I create a macro to read where the ticker begins and ends? Is there any way to do it w/o VB knowledge?
Raw Data:
[url]
Resulting Data:
[url]
More importantly, I want to be able to order the tickers by how many times they've been mentioned. For example in the second excel file called Result, Laura has been mentioned twice as often as anyone else. When I sort this list I want to sort by who's been mentioned the most. So I'd like to see 6 lines of her data, followed by the person mentioned the second most (if they had 5 lines, the next 5 should be them etc). For this one would pivot tables do the job, or do I need macro's for this as well?
View 13 Replies
ADVERTISEMENT
Jul 24, 2008
I have made a pivot table and I dlike to identify with a macro the documents with net value over 1000. Then extract these values next to the respective sales documents in an are near the pivot table somewhere. The fields are called Document and Sum of Net value. Of course the pivot is very variable one time it has 3000 records and another 5000.
View 9 Replies
View Related
Dec 14, 2006
i have a pivot table an extract of each data contained in this table.
[img]Count of NAMdate
SERVICENAM12-oct10-déc11-décGrand Total
Commercial-lauralaura11
Commercial-laura Totalgh11
custody-jonathanjonathan112
k11
custody-jonathan Totalgh1113
settlement-ludovicludovic11
settlement-ludovic Totalgh11
SPQC-elodieelodie112
SPQC-elodie Totalgh112
Grand Total1337
View 9 Replies
View Related
Jun 13, 2013
I have come across a situation where I am listing the top 10 customers based on their sales. I have a worksheet for each product I sell. I'm wondering if there is a way to write an excel formula to pull just the top 10 customers from just a single pivot table (respective to the product worksheet) instead of having to create a new pivot for every product and sort based on top 10 and then link to my spreadsheets?
View 2 Replies
View Related
Aug 13, 2013
I have an excel template populated with information. But I cannot extract the data to run pivot table.
View 3 Replies
View Related
Dec 26, 2013
I have a pivot table, and I would like to be able to have a formula or vba to extract the data to separate sheets. The pivot table looks similar to;
Row Labels
Count of FileSemester
John Smith
8
[Code].....
The pivot table consists of employee name (John Smith), followed by class code and qty. I have a separate spreadsheet for each employee and what I need to be able to do is to extract the class & qty into these spreadsheets.
View 4 Replies
View Related
Apr 13, 2004
I need to extract data from a spreadsheet given to me by my client, the best way to describe what I want to do is "a reverse of a pivot table"
The source sheet is arranged as follows:
Column A: Employee name every 3rd row
Column B: Normal Time on row 2, time and a half on row 3, double time on
row 4, normal time on row 5, time and a half on row 6 etc etc
Column C to I inclusive: Number of hours worked (on that day)
Column J: Subtotal of the 7 days (columns C to I)
Column K to Column DZ: Repeats of Column C to J
Row 1: dates in columns C to DY (except for the weekly subtotals)
I have many spreadsheets like this that I would prefer to have the information in a simple list format with the fields: Name, Date, Rate
Class (Normal Time, Time and a Half etc), Hours. Is there a simple/quick way to extract this information into the above mentioned fields? Am i being stupid and missing a simple solution?
View 9 Replies
View Related
Mar 19, 2013
On a worksheet, I created:
- a list of data
- a pivottable based on these data
When moving this worksheet this worksheet to another workbook, the pivot table can't refresh anymore. This throws an error message "Reference is not valid". To work around this problem I need to adapt the datasource. The same occurs if the list and the pivot table are on separate sheet, with the added strange behaviour that, when data an PT are split, it is not possible to move both sheet together.
This would not be a big issue if my problem had to be solved manually. The real problem is that I need to move the sheets from a C# program.
View 3 Replies
View Related
Feb 28, 2014
Macro to extract data from cells and populate them into a table. Go to the links below for the images. Why I can't attach images here.
HTML Code: [URL]....
View 2 Replies
View Related
Jul 10, 2012
I'm using a CALL Macro to split up a HUGE macro into different pieces:
Code:
Sub RSLDASHBOARDV2()
'Macro recorded 12/14/2010 by Ryan R. Koleno, Pharm.D.
'Last Updated 7/10/12 by Ryan R. Koleno, Pharm.D.
'Do Not Modify Code Unless Given Proper Privileges to do so.
Dim APPSPD As Worksheet
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
[code]...
The first few macros dealing with page setup and what not work fine but when it hits the Pivot table code for the STATSPIVOT macro it errors out stating: "Run-time error '1004': Unable to get the PivotItems property of PivotField class' at this point in the code:
Code:
objField2.PivotItems( _
"TRC").Position = 1
objField.PivotItems( _
"MEDCO MAIL OR AOB").Position = 2
When this macro is not split up it worked fine as written. Am I overlooking something in the Call Macro's code or is there a variable I'm not aware of. I have included the Pivot Table code that errors out as well.
Code:
Sub STATSPIVOT()
'STATS PAGE BASED ON STATS DATA TAB
Sheets("STATS DATA").Select
Dim objTable As PivotTable, objField As PivotField
ActiveWorkbook.Sheets("STATS DATA").Select
Range("A1").Select
[code]...
View 4 Replies
View Related
Jan 4, 2010
I'm trying to write a macro that will create a pivot table, and am getting an Error code 1004: Cannot Open Pivot Table Source File "Sheetname". My code is below. I've tried to note what each section does, and it all seems to work well except for the Pivot Table creation.
View 14 Replies
View Related
Mar 14, 2013
I have a worksheet with two pivot tables, one of which is visible to the user. Ideally, the user should be able to change the "Row Label" field settings of the visible pivot table and then press an "update button" that then adds the same field to the second pivot table.
Ideally, the ordering of the fields should also be made similar between the two tables, though this is of less priority.
I imagine it would be something in the style of:
"If number of Pivot1 active row label fields = X then
Pivot 2.AddRowLabelField = Pivot1.RowLabelField(X)
end if"
View 1 Replies
View Related
Jan 22, 2007
attached is a spreadsheet 6 people in my area use daily(ive copied and pasted the sheet in question to a new worksheet, as the file was too big). Ive been trying for about 3 days now to make a pivot table to summarise this data.
View 6 Replies
View Related
Jul 25, 2009
I have a pivot table macro below. It works great:
View 3 Replies
View Related
Jun 3, 2014
Can record the all those actions which we need to do on a regular basis. In my work i have to create the pivot table to a data which gets changed every day but the data sequence remains the same.
I have tried to record the macro for the pivot table but when i tried to run the macro again then the below error message comes.
"run time error 5" "Invalid procedure call or argument" when i click on debug then the below macro program is highlighted in yellow color.
View 1 Replies
View Related
Jun 23, 2014
I am trying to make a dynamic pivot table using VBA. Unfortunately, Im not very good.I have a set of data with variable number of rows and variable number of columns and I need to make a pivot table. Need to select this data from sheet - Master, where the first data entry starts in cell A1. of the data in the sheet, i only need the name and age title In the pivot table fields -
ROWS needs to contain - name
COLUMN needs to contain - Age
Values need to contain - count of Age
After this is done, since the data will be dynamic, the pivot table will also be dynamic. i need to copy the pivot table data and paste it in another sheet so that I can do some filtering. The filtering part I think i can do my self.
View 3 Replies
View Related
Aug 19, 2012
i want to make the pivot table using vba macro. the sample workbook looks likes this [URL]...
View 1 Replies
View Related
Apr 13, 2013
I've created a Pivot Table with 30+ fields. I've recorded the following macro to add the first field. I need modifying the code so that it looks for and adds every field automatically. It'd save a lot of time.
Code:
Sub PTAdd()
'
' PTAdd Macro
'
'
With ActiveSheet.PivotTables("PivotTable3").PivotFields("Assigned To")
.Orientation = xlRowField
.Position = 1
End With
End Sub
View 4 Replies
View Related
Jul 25, 2014
I got this code from another old old thread, is there a way that the pivot is already setup like column A is already in Row Labels, B is for Column Labels and C to Values.
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase,
SourceData:= _[a1].CurrentRegion.Address).CreatePivotTable
TableDestination:= _"", TableName:="PivotTable1"ActiveSheet.PivotTableWizard
[Code] ......
View 1 Replies
View Related
Sep 19, 2007
one part requires a pivot table to split two seperate pieces of data. the macro is running fine until this point when i get the AddFields method error (run time 1004). the Visual Basic error is as follows:
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Employee", _
ColumnFields:="Int.Ext"
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Lab Hrs")
.Orientation = xlDataField
.Caption = "Sum of Lab Hrs"
.Function = xlSum
End With
ActiveWorkbook.ShowPivotTableFieldList = False
ActiveWindow.SmallScroll Down:=-6
Sheets("FINISHED WORKSHEET").Select
ActiveWindow.SmallScroll ToRight:=4
Range("AA1").Select
ActiveCell.FormulaR1C1 = "Int Lab Hrs"
Range("AA2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-25],Sheet1!C[-26]:C[-24],3,FALSE)"
Range("AA2").Select
is this basically a write off or can anything be salvaged to make it run correctly. the pivot table will always use the same columns etc. every month it is run.
View 2 Replies
View Related
Mar 23, 2004
Creating a pivot table using a macro ...
View 9 Replies
View Related
May 1, 2007
I have a macro that I would like to run once I change a selection in my pivot t able. is this possible?
View 4 Replies
View Related
Jul 14, 2014
I'm trying to write a macro that will look up information about clients that result from a pivot table. Depending on what two inputs are put into the pivot table (coverage, existing or target company) the client names that the vlookup needs to reference will change.
The vlookup information for each client would paste into a different cell on another worksheet, and change depending on which clients came up in the pivot table. So the macro would need to look up clients from a specified range that the pivot table is in.
View 1 Replies
View Related
Jul 22, 2007
I have an excel file, attached. I have a system that output all the stock in the format of sheet "price listing".
At the moment I manually create the layout for the text in "sheet 1" and use a macro to update prices etc. There are about 400 lines in the full listing and having to update the layout constantly for new products, deleted products is very time consuming. I send this list to customers every few months for them to see the range and the prices, so it has to look well.
I am looking for a macro or a pivot chart or something that I would be able to run on the "price listing" sheet and would put it in some usable format. Different customers can have different prices so that it needs to be quick and flexible. I send this list to customers every month for them to see the range and the prices, so it has to look well. Is there any way to create an index also from an excel workbook?
View 10 Replies
View Related
Jul 14, 2014
I'm trying to write a macro that will look up information about clients that result from a pivot table. Depending on what two inputs are put into the pivot table (coverage, existing or target company) the client names that the vlookup needs to reference will change.
View 1 Replies
View Related
Feb 8, 2014
I have a report that has percentage of row totals that just displays as 100% for the grand total column. I want to hide that percentage of row column. I've attached the excel file below to see the pivot tables.
detail report.zip‎
View 3 Replies
View Related
Feb 11, 2014
Fixing a macro that i recorded in order to generate a pivot table on the same sheet and the same exact location every time. it seems that the macro fails every time i try to run and i'm thinking it has to do with the table reference. Again i want the table in the same sheet and the same location every time i run the macro. this is the recorded code so far.
View 1 Replies
View Related
Dec 8, 2011
Below is a recorded macro i am trying to apply on a pivot table.
Code:
Range("F4:H4").Select
Range("H4").Activate
Selection.AutoFilter
ActiveSheet.Range("$G$4:$G$100000").AutoFilter Field:=1, Criteria1:="21", Operator:=xlTop10Items
The problem i am facing is that when i am trying to run it is not working.
View 9 Replies
View Related
Jun 1, 2012
Below is part of my recorder macro for removing subtotal on a specific field:
ActiveSheet.PivotTables("PivotTable2").PivotFields("PRODUCT MANAGER"). _
Subtotals = Array(False, False, False, False, False, False, False, False, False, False, False, False)
I am new to coding in a pivot. I hope the no.of "False" depends on no.of "PRODUCT MANAGER" (There are 12 PRODUCT MANAGERs)
But the problem is the no.of PRODUCT MANAGERs vary with data.
So i am stuck on how i can input correct no.of "False" (here 12) inside the array part.
View 1 Replies
View Related
Feb 22, 2013
I am trying to to create a macro that will complete a Pivot Table, then use the Show All pages function. The data has the same number of columns each time, but the rows will differ each and everytime. The content of the column which houses the data which eventually will be a page can differ as well. I continue to get an errro and below is highlighted when debug is selected.
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Table1", Version:=xlPivotTableVersion12).CreatePivotTable TableDestination _
:="Sheet4!R3C1", TableName:="PivotTable2", DefaultVersion:= _
xlPivotTableVersion12
This is a very repititive pivot that is done many times during a month. I have tried just using the data as is then the pivot, and converting the data into a table, doesn't matter still get the error.
View 7 Replies
View Related