# Change Size Of Excel Data Table Dynamically

Jul 23, 2010

Is there a way to increase the size of the data table dynamically?

## Change Size Of Range Dynamically

Aug 10, 2007

Need assistance with this code provided by SHG. See attached sample. I need to create a range called DaysOff so that this function will work. As it is the function is perfect; though the accuracy if the result is dependent on the exact range, thus I need this named range to be dynamic. I have tried but it does not seem to work correctly. The named range should refer to the list of names between 1-10. The range should dynamically include any names that are listed.

Public DaysOff As Range
Function datNext(datLast As Date, DaysOff As Range) As Date
Dim datBeg As Date, datEnd As Date
Dim iLastPd As Integer
Dim iDay As Long, nDay As Long
Dim iYr As Integer, iMo As Integer
iYr = Year(datLast)
iMo = Month(datLast)
datBeg = DateSerial(iYr, iMo + 1, 1)
datEnd = DateSerial(iYr, iMo + 2, 0)
iLastPd = Pd(datLast)
nDay = DaysOff.Rows.Count
Do.......................................

## Excel 2011 :: Pivot Table Not Refreshing With Data Dynamically

Oct 7, 2011

Named my data range using this formula:

=OFFSET(Sheet1!\$A\$1,0,0,COUNTA(Sheet1!\$A:\$A),COUNTA(Sheet1!\$1:\$1))

I was hoping that my pivot table would refresh with the new data that I added on sheet 1 but it is not working and yes I have refreshed my pivot table. The new data is not capturing.

Is this the correct formula for Mac Excel 2011?

## Vlookup (name Range Change Dynamically When The Pivot Table Is Refreshed)

Oct 26, 2009

I have the following vlookup formula in my spreadsheet.

IF(ISNA(VLOOKUP(\$A2,'Purchase Order Pivot Table'!\$5:\$500,67,FALSE)),0,VLOOKUP(\$A2,'Purchase Order Pivot Table'!\$5:\$500,67,FALSE))

It works perfectly for my current requirement, but it looks at data in a pivot table which is created from a dataset. If I name the columns in the pivot table so instead of looking at column 67 it looks at a name range will this name range change dynamically when the pivot table is refreshed? If not how can I get it to.

## Pivot Table That Get Data Dynamically

Mar 11, 2007

I wonder if is it possible to get data in the pivot table dynamically?

For example, I do insert data through the userform [ new department] and when I run the report I see the new entered data in the pivot table. will I have this new department title in the list box in the pivot able?

## Excel 2010 :: Change Font Size In A Checkbox?

Jan 30, 2013

How do you changethe font size in acheckbox in excel 2010?

## Excel 2007 :: Pivot Table Cache Size Limit With VBA

Aug 20, 2008

I am trying to create multiple pivot tables from the same pivotcache using VBA. The data range is approximately 270,000 records with 100 columns. When I run the macro, I get "Run-time error '-2147352567 (80020009)' Method 'Add' of object 'PivotCaches' failed". Is there a size limit on the data? If there is less than 65,000 records, it works great; if I use a wizard, it works with no problems with the full dataset. If I bring the data in as an Access table, it can work with some tweaking of the code, but the size of the file is huge because each pivot is taking its own snapshot of the data. I also can only create 3 tables before it runs out of memory, so I have to stop, save the file, and open it back up to create 3 more pivots.

Dim WSD As Worksheet
Dim PTCache As PivotCache
Dim PT As PivotTable
Dim PRange As Range
Dim FinalRow As Long

[Code] .........

The last line is where I am getting the error. I am running XP, Excel 2007.

As I said, if I import an Access table, I can use the code:

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Table_Pivot_test.accdb[#All]", Version:=xlPivotTableVersion12). _
CreatePivotTable TableDestination:="", TableName:=txtPivotTableName, DefaultVersion:=xlPivotTableVersion12

And loop, but the final file size with 14 pivots can be 500MB! I have tried both "Create" and "Add", but they both give me errors.

## Pivot Table Data Size Differs

Feb 20, 2008

I have all of my pivots all set up and all of my charts running from them.

My challenge is in pasting in the new data every day into the master Sheet BECAUSE, in order to group the dates (from format 20/02/08 into Month and Years in the pivot) you have to 'WRAP' the data, instead of simply blocking in all of the columns......

The challenge is that everyday, the data size differs, e.g; one day it might be 2000 rows, and the next 22,000 rows.

SO,,,,, BECAUSE I HAD TO 'WRAP' THE DATA (IN ORDER TO GET THE DATE FORMAT I NEEDED) >>>>> HOW DO I GET THE PIVOTS TO CALCULATE ONLY USING THE CHANGING AMOUNT OF ROWS

## How To Write Data Of Different Size From Matlab To Excel

May 29, 2013

I have got many files lets say 30 files ,in each file there are 3 columns of data but the no: of rows varies for each file .for eg 1 file has got 6 rows and 3 columns then next file has 3 rows and 3 columns etc .i was not able to append it since its size varies.i need 2 write all these data in an excel sheet also . As u can from the excel sheet for clearance which i have done manually for a single speaker.like dis i have got many speakers so i need 2 code it

## Excel 2010 :: Macro To Change Excel Formatted Table Name Dependent On Number Of Loops

Jul 9, 2012

Recorded macro. The hope is to insert a excel formatted table a set number of times. I have found a loop code that references a Cell A1 and repeats that amount of times. So if A1= 10. There should be 10 tables inserted. However on the second time there is a fault with the table name. I need the name to change each time the loop is run. ie Table1, Table2, Table3 etc up until the loop stops (A1 contents).

I am using excel for windows 2010. The macro that i have so far is below.

Sub LoopTest()
Dim n
Dim V
Range("A1").Select
V = ActiveCell.Value

[Code] ........

## Transfer Data Table 1 To Table 2 Change Rows To Column?

Mar 13, 2013

Table 1
January-12
February-12
March-12

Table 2

Sr. No
Name
Dep
Lates
CL / SL
AL
Lates
CL / SL
AL
Lates
CL / SL
AL

[Code].....

May 21, 2014

Now i have to compile 3 years of data for 200 airports so changing the month and year for every airport would be a challenge. I can do Replace all and change the year and month but instead of that i was thinking if i could have the year and month on one row and connect the links to that cell so that whenever i drag the cell my link changes

im looking at

where in D2 i will have 2014-04 . But this formula doesnt seem to work. Is there anyway i can do this ?

## Dynamically Change USERFORM

Jul 29, 2009

or it's text box/ labels depending upon learning of how many records the application is working with?

I remember some body here has said that you could either
1 - create many labels and text box and then once run the application hides the number of the ones not use or

2 - you could once run the application have visual basic create label and text of the right number associate with the number of records working with.

I have looked at both these option and have found nothing. So is this possible and show some examples if you have them.

## Macro To Dynamically Change Y Axis

Jan 2, 2012

I have used this code a number of times to automatically change the scale of x axes without problem. I have just used it however and it has condensed the data so that it the line only appears in the last quarter of the chart.

Code:
Option Explicit

Sub ChangeStaticAxisScales()
With Sheets("Static Charts").ChartObjects("Chart 2").Chart

' Value (Y) Axis
With .Axes(xlValue)
.MaximumScale = Worksheets("Raw Data").Range("AN7").Value
.MinimumScale = Worksheets("Raw Data").Range("AN6").Value
.MajorUnit = Worksheets("Raw Data").Range("AN8").Value
End With

End With
End Sub

## Dynamically Change The End Value Of A Range In A Function

Jul 20, 2006

I am using the STDEV function on a range of values: STDEV(\$I\$26:I2545). My starting cell is constant and I would like to make my ending cell variable based on a value I enter in a master cell (A1). The value I enter in the master cell is multiplied by 252 the product would equal the row number I would like to stop at. So if I enter 1 the formula will be STDEV(\$I\$26:I252). I tried: STDEV(\$I\$26"I"&(A1*252))) and other such variations to no avail

## Change Chart Range Dynamically

Sep 24, 2006

I maintain Production data in an Excel Sheet and have the code which will create Chart for each Employee. Sample Sheet Attached. However, I want the Chart Range to be updated in a Single Chart and exported to a .Gif File.

## Dynamically Change How Values Are Displayed In A Chart

Dec 23, 2013

Is it possible to dynamically change how values are displayed in charts?

I have a list which references different named ranges. It either needs to display the values in a graph as a number (without decimals) or a percentage depending on the source. Is this possible? Maybe with some VBA? Or am I asking too much from excel?

## Chart Loop To Change Axes Dynamically

Oct 11, 2006

I've got an excel worksheet that contains charts 5-14, each with different max axes on primary and secondary scales. Right now the code below works to adjust the axes, however I have pasted this into a script 10 times, once for each chart with different references to the chart number, the max primary axis and max secondary axis. how I could write the following as a loop so that I don't need to have to repeat this routine in my code?

Sub ChartsBillingsShare()
ActiveSheet.ChartObjects("Chart 5").Activate
With ActiveChart
.HasAxis(xlValue, xlPrimary) = True
.HasAxis(xlValue, xlSecondary) = True
End With
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = Range("Y6").Value
End With.................................

## Change Caption Of Dynamically Created Label

Jun 26, 2007

For a form that dynamically creates a series of text boxes and labels, does anyone know how to change the caption of a dynamically created label to display the value of a cell in a worksheet? The cell in the worksheet changes according to input on the text boxes. In the form's code, I have:

Dim newLblFreq As MSForms.Label
Set newLblFreq = Me.Controls.Add("Forms.Label.1", "lblfreq" & i, True)
newLblFreq.Caption = Range("V" & i).Text & " Hz"

But once the label is created, the caption won't change, even if Range("V" & i) changes...............

## Change External Link Dynamically With Cell

Apr 14, 2008

My Example

I have Master Book1 which has external links to Book2, Book3 and Book4.

My Formula in Cell B2 is ='D: empxl[Book2.xls]Sheet1'!\$A\$1

In Cells A1, A2 and A3 I have the text entries 2, 3 and 4 respectively.

Is it possible to use these Text entries to update the Formula I plan to copy down from B2 onwards?

i.e. Formula would read something like ='D: empxl[ Book"A1".xls]Sheet1'!\$A\$1

## Dynamically Created Tab As Table Name In SQL Query

Jun 8, 2014

I am having a excel vba code that copies tab from different excel file and then i want to use in sql query. It is always giving me error saying that "The Microsoft Access database engine could not find the object 'rahul'. Make sure the object exists and that you spell its name and the path name correctly. If 'rahul' is not a local object, check your network connection or contact the server administrator."

Though, when i rerun the macro after reopening the excel file, it is working fine. Seems like tabs dynamically created cant be used. Is their any way to get it done at runtime? I want to delete new created tab once data from new tab is inserted to required tab.

my macro calls first copyAllSheets(filename) and then writeSheet().

Code:

Private Function copyAllSheets(ByVal fname)
Dim destSheetCount As Integer
Const FUNCNAME = "copyAllSheets"
On Error GoTo ErrorHandler
Set wb = Workbooks.Open(fname)
destSheetCount = ThisWorkbook.Worksheets.Count + 1

[code]........

This is part of code so probably it wont be easy to understand the flow. but mainly i want to know how can i have newly created tab as table_name.

## Excel 2010 :: Pivot Table Change Event

Mar 22, 2012

I have three worksheets Sheet 1, Sheet 2 and Sheet 3 with three Pivot Tables

Sheet1 - Sheet1Pvt1
Sheet2 - Sheet2Pvt2
Sheet3 - Sheet3Pvt3

When I use In Sheet 2 the following lines of code

Private Sub Worksheet_PivotTableChangeSync(ByVal Target As PivotTable)
Application.EnableEvents = False
Application.ScreenUpdating = False
MsgBox "The pvt table refreshed " & Target.Name
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub

and even If I Refresh Sheet 3 pivot table, Sheet 2 Event is triggered and it prints "The pvt table refreshed Sheet2Pvt2";

How to restrict the event code only to Sheet 2 and pvttbl Sheet2Pvt2.

## Excel 2010 :: Change Pivot Table Source With VBA?

Nov 25, 2013

I am using Excel 2010 and have a workbook with two sheets - "Risks & Issues" which contains the source data and "Risks - Summary" which contains a Pivot Table called "Dashboard"

I would like to create a command button called 'Refresh Data' which will be on the "Risks - Summary" sheet. When I add a new line to the "Risks & Issues" sheet, I would click the button in "Risks - Summary" and it will update the Pivot Table range.

So far I've tried using some examples found on this site, although with no experience in VBA macros, I'm not really sure what they do; all I know is that they cause an error.

Code:

Sub Refresh_Click()
Sheets("Risks - Summary").PivotTables("Dashboard").SourceData = Sheets("Risks & Issues").Range("A2").CurrentRegion.Address(True, True, xlR1C1, True)
End Sub

[Code].....

Aug 21, 2014

I have a list or log that is updated by a number of people on a sharepoint file. The list consists essentially of 2 columns - lets call them Location and Date.

The Locations are populated from a pulldown list but can be repeated a number of times throughout the list. I have the list set up using Table Formatting so the range updates dynamically

Example:
Location Date
Site1 8/1
Site2 8/2
Site3 8/3
Site4 8/5
Site2 8/6
Site2 8/7
Site3 8/8

As this list gets items added to it I want to populate a summary table on another sheet showing the dates each site was visited like this...

____8/1 8/2 8/3 8/4 8/5 8/6 8/7 8/8 8/9
Site1 X
Site2 -----X-------------X---X
Site3 -------X
Site4 --------------X

(Had to add dashes above to get the X's spaced out properly)

I'm competent with lookups and such but I imagine this needs an array formula or some index/match combination which I'm a little weak on.

The solution should also not require any updating as the source list is updated periodically.

## Dynamic Table: Get The Formula In The Cell To Update Dynamically

Aug 21, 2006

I have a table which takes the average of the last three years. The formulas are in cells below the data. The data is set up to be first data down to the oldest data. each time data is added, a row is put in on top. how do i get the formula in the cell to update dynamically. What would the average formula look like in the cell? Do you just say =average(name of file!RANGENAME).

## Dynamically Sort Generic Pivot Table Field

Feb 15, 2008

Is there a way to generically sort all pivot rows of a pivot table alphabetically each time the table is refreshed? I have a pivot table that pulls its data from a dynamic named range on a separate worksheet. As users add data to the range and refresh the pivot table the newly added items appear at the bottom of the table rather than alphabetically. I know how to specifically call out a pivot row and have it sort alphabetically (see code below) but I still want to allow users the flexibility of changing the fields and order of the pivot rows so specifically calling out a pivot row by field name isn’t going to work. I need to somehow add code that says: For each pivot row (1 to n, where n = number of pivot rows) sort each in alphabetical order.

ActiveSheet.PivotTables("ptDWDM").PivotFields("Project Name").AutoSort _
xlAscending, "Project Name"

So in the above code I don’t want the reference to “Project Name” to be hard coded.

## Excel 2010 :: Change Spacing Between Dates In Pivot Table?

Mar 27, 2013

I have a pivot table with dates along the x-axis. The data is spread out over 5 years and the spacing between sampling events is not even, therefore, the spacing of my x-axis dates is not even. I want the x-axis to look similar to a normal graph where there is equal space between each month, even if I don't have data for each month. I do not want to group the data to accomplish this. If I click the "show items with no data" it only shows one extra day, not all days or even all months. I have excel 2010.

## Excel 2010 :: How To Auto Update PowerPoint Table When New Data Entered Into Table

Jun 12, 2013

I have created a table in Excel 2010 (pls see attached table named post.xlsx).

Then copied the above table into PowerPoint 2010, using "paste link" (I tried to attach the PowerPoint file but the system says "invalid file type" and I cannot attach it).

Question:

I have received income data for another month - the new month is 13 and the corresponding new income is 100.
I typed 13 and 100 into the Excel table post.xlsx and thus extended the table by another column.

Then I went back to PowerPoint slide, then right clicked on the table there, then clicked "update link".

Specific Question:

The newly-typed column in Excel table is not get updated in PowerPoint table.

## Excel 2010 :: Adding Percentage Change Column To Pivot Table?

Mar 17, 2012

I am trying to add columns to my Excel 2010 Pivot Table to calculate % change of sales from year to year. The field name is "Year", while the item columns in the field are 2007, 2008, 2009, 2010, and 2011. How do I add a column between the years that will calculate the % change os sales up or down from the previous year?

## Change Size Of Tab Font

May 7, 2009

Somehow my tab names (in 2003) have a very small font size. How do I return the size to normal?