Macro To Refresh Pivots Also Resets Chart Data Label Fonts
Aug 20, 2013
I have 6 pivot charts within a document. I use a macro associated with a button to refresh the tables and therefore the data displayed on the charts.
However, each time I refresh the data, the 'data label' font size also refreshes. What is particularly odd is that 5 of the charts are pie-graphs, of those 5 graphs, the font size only resets on 4 of them (with the data labels in a single chart staying at my desired font size).
I can manually put the font size back to that which I desire but I'd rather it just didn't change in the first place.
I've had a look to see if there's any noticeable differences between the 5 charts but there's nothing which I can find.
I'd be happy to run a bit of VBA to set the font size as I want it, if there isn't a better solution.
I have a spreadsheet that has about 40 pivot tables that use label filters for filtering HH:MM and "greater than" selection. When I do a refresh, I have to go back and reset the label filters. Is there any way to not have to re-do every label filter after refresh? I have looked at all the settings and didn't see anything in there that looked like it would work. Maybe VBA?
I think that this is probably rather simple, but the answer is eluding me, I cannot find anything that helps online either. I have a set of data that looks similar to the sample below, however it is quite a bit longer. I would like the 'Effect' as the X axis, with the 'Score' as Y. This basically shows three columns, which is fine. However I would also like to use the 'ID' as the label against each plot point and I'd like each plot point to look the same.
The problem I am having is that to get the labels to show, I am having to add each series manually, which is rather time-consuming. Is there a correct (faster) way of doing this as I think I'm missing something obvious!
I'm working for a local authority who have been given a mass of survey data. In this particular task, residents of each small district within our area have been asked their levels of satisfaction with a service, and how important they think that service is. I want to plot these two values against each other using a scatterplot, and label each service.
Excel does not automatically allow this so I used a very good sheet from the forums here: Attach labels with names to the points in a scatter plot. It's the top file, and works well. However, I can't seem to customise it for my own data.
- Excel often freezing when I try to run it - Not all the data being picked up for the chart - Incorrect labels being picked up..........
I have created a pivot table and chart. The pivot chart consists of three sets of data from the pivot table. Two of the data sets are lines and the third data set is displayed as columns. I made the third data set into columns by right clicking on the data series line and selecting chart type. I change the chart type for that data set to a column and it worked great. The only problem is that when data is refreshed in the associated pivot table, the entire chart turns into columns with completely different formatting. Does anyone know how I can maintain the graph with the two lines and one column data set when I refresh the data?
I see some code on the forum on how to automatically refresh pivot tables in excel. I know to press alt + f11, but where do I go from there to put the code in? Also, what if I have several pivot tables in the spreadsheet, is there anyway to refresh all of them automatically?
I have a workbook that pulls in index data from Bloomberg, most data is updated realtime, but one index we track is only updated late at night. I want to write a macro that will refresh all of the data in the worksheet and then save a snapshot of the workbook. I have all the code for saving the snapshot, but getting the data for the one index to refresh is proving difficult. None of the standard ways I know to refresh external data (both Excel commands via tools menu, and Bloomberg specific refresh commands) seem to work on these cells. The only way so far I've found to get these cells to pull in current data is to delete them and rewrite the formulas.
suggestion for a Macro that would force a refresh of this data?
i have an excel spreadsheet with 27 or so workeets. it contains sales figures in it. I want to be able to link mutiple cells of this workbook to another workbook so that it retreives that data, So that when I hit the refresh (!) button it will automatically put the data in. I will recieve new sales figures (new files) on a monthly basis so i want it to be able to update the figures to the new figures.
I have a macro that is supposed to update 3 pivot tables with the change to just the first one but it doesn't work. Can anyone help?
Here is my code but nothing happens when I change the first pt (C & S). It doesn't update the other 3 tables.
Private Sub Worksheet_Calculate() Dim PF1 As PivotField Dim PF2 As PivotField Dim PF3 As PivotField Dim PF4 As PivotField Dim x As String Application.EnableEvents = False Application.ScreenUpdating = False Set PF1 = ActiveSheet.PivotTables("PivotTable4").PageFields("State") Set PF2 = ActiveSheet.PivotTables("PivotTable3").PageFields("State") Set PF3 = ActiveSheet.PivotTables("PivotTable2").PageFields("State") Set PF4 = ActiveSheet.PivotTables("PivotTable1").PageFields("State") x = PF1.CurrentPage PF2.CurrentPage = x PF3.CurrentPage = x PF4.CurrentPage = x Application.ScreenUpdating = True Application.EnableEvents = True End Sub
Pivot Table 4 = C & S this is one I want to make the change to Pivot Table 3 = Sales Pivot Pivot Table 2 = 2005 Pivot Pivot Table 1 = SMG Pivot
I have a workbook, which I use for different departments that displays a number of different pie charts and I have found that a particular pie chart omits a specific label repeatedly. The pie chart displays the wedge within the chart itself, but does not display the label. At the moment I have data labels with percentages. All other labels display, of which there are 7. I found a solution that fixes the problem each time it arises and that is to select Chart Tools/Format/Series 1 data labels and then Format Selection. When I then select any data label, I click on "Clone Current Label" and the missing label appears with the correct percentage amount. I use the workbook for multiple uses and rather than have it present as a template (*.xltm), it is a macro-enabled spreadsheet (*.xlsm). Could this be related to the problem?
When you hold your mouse over a bubble on a bubble chart, it typically displays the x value, y value and size value. Is there any way to add other captions to display? For example, if my chart is based on sales data and I'm plotting a point based on ease of probability (x axis) and dollar value (y value)....I'd also like to see the initials of the salesperson assigned to that prospect when I hover over the bubble?
In the attached spread sheet I have created a scatter plot. How can I label each of the markers with its appropriate label from Column A - the Company Ticker. When I right click to show data labels it brings back the incorrect column. Also is there a way once the labels are brought in to put them in the circle and so that the chart doesn't look too clumped together.
have come across the apparent inflexibility of a pivot chart retaining its user defined formatting whenever it is refreshed.
I understand I can save my chosen formatting as a 'user defined' custom chart, which can be applied post-refresh, but was wondering if a simple bit of code would do this automatically, saving the additional clicks!
how to deal with the attached. How could I adapt the code to call in other 'user defined' charts I may create in the future?
I'm developing a series of schedules that organize building plans. In one schedule I maintain a list of areas (called spaces, like a lobby or a conference room). I programatically maintain the list of spaces in the schedule for sorting and other external functions that are irrelevant. In the process I occasionally delete a worksheet. My worksheets have 4 buttons and a combobox. Whenever I delete a worksheet with these objects, I lose ALL of my module-level variables. These include two collections, a boolean, and an integer.
I'll post only the code for now. If you want to replicate, remember to place at least one button or combobox on your worksheet. You'll need to execute each sub manually. I have placed debug statements to print the globals to the immediate window. Notice that the 3rd debug statement shows the globals as present when it's called from the delete routine; however, if you manually execute that print routine after the delete, the globals are gone!
Option Explicit Const SHEET_TARGET_RANGE As String = "C13:K36" Dim m_objLocal As New Collection Dim m_objMaster As New Collection Dim m_bln As Boolean Dim m_int As Integer Public Sub Debug_Populate_Globals() Dim intLoopCounter As Integer Set m_objLocal = New Collection Set m_objMaster = New Collection For intLoopCounter = 1 To 8 m_objLocal.Add intLoopCounter, CStr(intLoopCounter) m_objMaster.Add intLoopCounter, CStr(intLoopCounter)....................
I want to automate the Display labels in my Charts using VBA Coding…
I would need to use this small code in Charts with different Scales as some of the Scales in my Data are in a very large Range close to Trillions so its not possible to have these as the Primary-Y-Axis Scale and therefore I would need to use the in-built Display label option which Excel provides..
However, I always prefer to have the scale in the Range of Thousands so the Max I can have in the Scale can be 10,000 so if there is any Number more than that or the Scale is going above than I would prefer that this gets auto-calculated to Multiply with the remainder and show appropriate Scaling.
For Ex:In this example My largest Number is 4500000000 which is 100 M..So I would want the scale to show 4500 and the Display label as X Millions..
So The Display Label would be different for different Ranges but the Max Scale preffered would be 10,000.