Auto Chart Positioning By VBA Or Other Settings

Aug 8, 2006

i try to change the chart position (chart properties) to make it auto- move to empty cells, but anyway i fail.

say example:-
i have a excel sheet,

Worksheet 1
------------
raw data, all records.


worksheet 2
-------------
1 pivot table + a graph/chart at the same sheet.

top area of worksheet is pivot table, below is chart.
The pivot table size can be change from time to time (by increasing the records at the worksheet 1)

settings or using vba to control it? by auto move the chart position down, and not overlap with the pivot table.

View 6 Replies


ADVERTISEMENT

Works With US English Settings, Errors If Italian Settings

May 19, 2008

The following line of VBA code executes properly if machine settings are US English, but throws a "Run-time error '1004': Application-defined or object-defined error" ? ...

View 9 Replies View Related

Excel 2007 :: How To Adjust Protected View Settings But Protected View Tab Is Missing From Trust Centre Settings

Dec 12, 2013

Excel 2007 - need to adjust protected view settings but the protected view tab is missing from my Trust Centre settings - have the following tabs - trusted publisher / location, add-ins, activeX, macro, message bar, external content and privacy options. Document is a revenue authority download and without being able to adjust the protected view settings, can't input data.

View 3 Replies View Related

Positioning A Picture

Jun 2, 2014

I've got the following code going :

[Code] .....

I can't get my With statement to work.

View 1 Replies View Related

List Box Positioning

Apr 10, 2009

I've got an Excel spreadsheet with quite a bit of code behind it (2007).
User can select a cell in Col A and push 'F2" and a ListBox pops up (becomes visible).
But if the User is on line 72 say, then the box is in the wrong position (and often becomes visible with diagonal lines across it!); that is I need to determine where the User is and set the ListBox position further down.

I tried to do this by calculating the offset based upon the row number they were on. This works really well, unless, the lines/records are varying heights.

Is there an easy way to do this ????? I have this feeling I must be missing something really simple about how this should work - I'm sure there must be a way that Excel has to handle this.

View 9 Replies View Related

Positioning Shape Objects In VBA

Aug 22, 2006

I am trying to work out how to pisition a new object in some VBA code, I can do this if I copy an object then click on a cell, e.g. H74 then paste, but the properties for an object want this in points.

ActiveSheet.Shapes.AddShape(msoShapeOval, 50, 50, 26.25, 26.25).Select

What I want to do is select the cell H74, then find the coordinates for that cell then use these when creating the shape, I appreciate these coordinates will need to be assigned to variables, but how do you get then from a given cell?

View 3 Replies View Related

Sizing And Positioning Of Shapes

Feb 14, 2007

I have a workbook where each name in a list has a picture of a flag of the country for that name. The flags are initially assigned to a cell with the country name (see sample attached). Later in the project the flag is copied to a cell in another sheet and assigned to the correct name in the list. The row heights in this list of names is larger than the row height of the sheet with list of countries.

The flags in the sample have been manually sized and positioned as accurately as possible. I am struggling with the VBA code to size and position each flag exactly so that there is a very small gap between the top, bottom and left of the flag and the cell border. Each is set to move and resize with cell.

View 2 Replies View Related

Auto Chart W/IF Funtion

Feb 2, 2008

Chart updates correctly when new pricees added.

But my IF function in column C leaves the annoying line to zero until prices are enter in column B.

View 9 Replies View Related

Positioning Of Validation Input Message

Apr 2, 2009

is it posible to control the positioning of the pop-up data validation input messsage box via vba? As often it obscures the view of critical cells below.
You can manually click and drag it to a desired position manually. Mana users are not aware of that. It would be desirable to reposition it elsewhere rogramatically.

View 2 Replies View Related

Resizing Charts And Positioning Legend

May 4, 2007

I have made charts in VBA charts that needs to be placed on specific position and have specific sizes on a chartsheet. I use plotarea (top, left, width, height) for that. Unfortunately when I set these values they keep chaning, there is some scaling going on in Excel and they won't get the specified size. I have been looking on the internet and finally I found a piece of code which works, but still not good enough, because the legend is also not good positioned

De data for resizing the new charts (ChtNew), the legends and the charttitle I get from other charts (ChtOrig). The legend.legendposition of ChtOrig does not have a value but it still have a top,left,height en width which I use.

I show you my code, the part with the for-next is taken from the internet.
I am trying to find a solution now for 3 days and now I only dream of huge charts (which is not good). So please can someone help me with this? This is the last forum, that I can try, I didn't get reactions from others.

with ChtNew.legend
.Top = ChtOrig.Legend.Top
.Height = ChtOrig.Legend.Height
.Left = ChtOrig.Legend.Left
.Width = ChtOrig.Legend.Width '* 1.1
.Top = ChtOrig.Legend.Top + ChtOrig.ChartTitle.Top
end with

With ChtNew.Plotarea
.Top = ChtOrig.PlotArea.Top
.Height = ChtOrig.PlotArea.Height
.Width = ChtOrig.PlotArea.Width
.Left = ChtOrig.PlotArea.Left

For i = 1 To ChtOrig.PlotArea.Top........

View 9 Replies View Related

Positioning Input Validation Message Box

Jan 9, 2008

I am using data validation input messages for data entry tips/definitions. The data entry cells are grouped in small tables (about 5 rows X 6 columns) so when the user clicks on a cell, the data validation input message box pops up next to the active cell. This covers the adjacent cells which need to be completed as well.

If I drag the message box over to right of the input table, the messages for the other cells stay in the new location as well. However, Excel doesn't remember this location the next time the workbook is opened.

Is there a way to set the location of the message box or some other way to achieve the same objective of having text boxes pop up in a defined location when a cell is activated?

View 9 Replies View Related

Copy Paste With Macros - Variable Positioning

Jul 12, 2007

Using a macro, how do I tell Excel to:

1. Copy the xth row and paste it before the yth row

2. Copy the mth column and paste it before the nth column

3. Copy the cell a,b and paste it in he position c,d
where x,y,m,n,a,b,c,d are variables, the value of which the user inputs, say in cells A1, A2, A3, A4, A5, A6, A7 and A8 respectively.

In other words, I need to read numbers m and n which are the values of cells A1 and A2, then I need to go to column number m (for instance, if m=4, I go to column D), copy the whole row, go to column number n (for instance, if m=6, I go to column F), and insert the copied column.

Also wondering if VBA provides any way to quickly horizontally and vertially flip copied tables while pasting. While I am aware of the transpose function which swaps rows with columns, I am looking for a way to reverse the order of either the rows or the columns as per my need, without having to copy-paste row-by-row or column-by-column.

View 9 Replies View Related

Zoom Level Affects Shapes Positioning

Jun 30, 2008

Sub CreateRectangles()
X = 1
Do Until ActiveCell.Offset(X, X).Value = 0
X = X + 1
Loop
variable = Round(-0.026 * (X * X * X) + 0.56 * (X * X) + 24.7 * X + 5, 0)

Set Box = ActiveSheet.Rectangles.Add(ActiveCell.Offset(0, 0).Left, ActiveCell.Offset(0, 0).Top, variable, variable)

With Box
.ShapeRange.Fill.Transparency = 0.3
.Font.Size = 18
.Font.Name = "Trebuchet MS"
.Text = ActiveCell.NoteText

End With

End Sub

View 3 Replies View Related

Auto Select Populated Cells For Chart

Dec 26, 2011

Seeking a way to automatically select just the populated range of cells in Cols A, B and C starting with row 2. In this sample there are 48 however this changes.

ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlBarStacked
ActiveChart.SeriesCollection(1).Name = "=Sheet1!$C$1"
ActiveChart.SeriesCollection(1).Values = "=Sheet1!$C$2:$C$48"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Name = "=Sheet1!$D$1"
ActiveChart.SeriesCollection(2).Values = "=Sheet1!$D$2:$D$48"
ActiveChart.SeriesCollection(2).XValues = "=Sheet1!$A$2:$A$48"

View 1 Replies View Related

Auto-Extending Graph/Chart Range

Aug 21, 2008

I have a Line Graph with 2 lines on it. Is it possible to write a macro to extend the range (Source range) of one of the lines ? I would also like to add a Data Label to the newly added point.

For e.g. If I have Line 1 graph only till 65, I want the macro to extend the range by one row to include 95 and also display a datalabel ......

View 9 Replies View Related

Auto Size Dynamic Changing Chart

Jun 14, 2008

I have created a dynamic chart in excel where either the number of Series or the number of Data Points will change dependent on user inputs in the model. I've done this using the Offset Function in a Defined Name in Excel and dropped this Defined Name into vba code using ActiveChart.SetSourceData.

Anyway, all works fine, pulling the correct data, etc. What doesn't work is the final appearence of the chart. The chart has a Legend placed at the bottom of the chart, as standard, unless there is only one Series, when I remove the legend altogether. Whilst the legend works fine, the Plot Area of the chart doesn't update automatically to accomodate the changing size / existence of the Legend. Does anybody know how to do this? I tried using hieght, etc properties, but I don't know how to make them variable

View 4 Replies View Related

Excel 2007 :: Control Positioning And Size Of Window?

Mar 13, 2012

My set up office 2007 win xp pro ie 8 I am using the code below to retrieve web pages etc it works fine, however it display in differ areas of the screen, so I was wondering if there is a way to control the positioning and the size of the window?

Code:
Set EXP = CreateObject("InternetExplorer.application")
EXP.Visible = True
EXP.Navigate (aurl)

[Code]....

View 2 Replies View Related

Positioning A Specific Cell In The Upper Left-hand Corner

Jul 31, 2006

Is there a way (in VBA) to position a specific cell of a worksheet in the upper left-hand corner (i.e. cell H40)?? I have some code that I'd like to have do this.

View 3 Replies View Related

Auto-Populate Items From Master Reference Chart Based On Job Description

Dec 3, 2012

I have attached the sheet :

Certain job descriptions require certain training. Drivers needs these two particular trainings and an office employee only needs that training...

I have a reference sheet with what trainings are required for what job. I then want the next chart with each employee name and subsequent job title to have the required trainings automatically checked. (I can take care of the conditional formatting after that).

Job Desc.xlsx

View 5 Replies View Related

Restore My Settings

Mar 26, 2007

i made XL App settings in a way suits my needs...........

Is there a code to restore these settings when i reinstall the XL App ?

View 3 Replies View Related

Message Box Settings

Apr 27, 2007

Are there any settings that can be applied to a message box? ie changing the background colour or header colour etc.

View 2 Replies View Related

Change The Default Settings

Dec 16, 2008

how do i change the default settings in excel, for example when i open excel it shows numbers on both rows and columns and i want it to show letters on the colunms. i know how to change the r1c1 reference style but how do i get it to stay the way i want?

View 4 Replies View Related

VBA Causes Errors When Run In German Settings

Jul 10, 2014

I have developed a process design application in Excel using User Forms to input data. The data are placed on a sheet of a workbook with the majority of the calculations being done by cell-to-cell calculations so that users can view the formulas if they so desire. This application works well in English. We want to use the same application in our German office where it has not worked well.

In order to trouble shoot the problems, I can go to the Region and Language setting under Control Panel and set it to German (Germany). This converts the number format to a period for the thousands separator and a comma for the decimal. This seems to create a lot of problems for VBA that I have not been able to sort out.

To simplify the problem I have written a very simple program. It has one User Form with two text boxes for number input, an Enter command button and a Close command button. Sheet 1 has a command button that opens the User Form. In the User Form, I enter a number in both text boxes and click Enter. VBA code then enters the number from Text Box 1 in Cell A1 and the number from Text Box 2 in Cell A2. Cell A3 has an equation that calculates the sum of A1 and A2. All cells are formatted as General.

The workbook works as expected in English. When I set my PC to German (Germany) the application works as expected when I enter an integer in the text boxes. However, if I enter a decimal such as, in the German format, 10,5 and 5,5, the numbers entered into the spreadsheet are text (left justified) and the sum is zero. I have to enter 10.5 and 5.5 to get the numbers to enter as actual numbers and give the correct sum.

How to make VBA work with the German settings?

View 1 Replies View Related

Macro To Delete Row As Per Settings

Mar 10, 2014

I have a large file of data and the data looks like this repetitively, however, there are also useless data. But I figure out that the repeat data looks the same compare to the useless data. I need to extract the data that I only need. Is there a way to set a macro to search for a String from the beginning of the excel file, when the string is found, it will keep the 2 rows above and 56 row below it, then loop.

Here is an example of it:

A1 USELESS DATA
A2 USELESS DATA
A3 USELESS DATA
A4 USELESS DATA
A5 GOOD DATA

[Code] ....

The macro will start from A1 then go down till find STRING, then will keep 2 row above it which is A5+56 row below it which is A63.

Then continue at A64, then find STRING at A66 and do the same which is copy A64 (2 row above)+till A122 (which is 56 row below), then continue.

Since A123 to A155 does have any STRING, they will all be deleted..

View 3 Replies View Related

API Call International Settings

Dec 3, 2008

I change the international setting by using the API call shown below. The settings change, but is not activated before I exit Excel and go in again.

View 7 Replies View Related

Macros And Printing Settings

May 8, 2007

Enable Macros to open it. No one else does.

Second, all the rest of us can click the print button to print the one single page that we are viewing. He says when he does this, that each time it automatically starts printing all the pages in the workbook. He wants to only print the one page.

View 9 Replies View Related

Save & Re-Use Print Settings

Feb 15, 2010

Is there a way to force a print RANGE, and add settings such as margins, and print to range to 1 page wide and 1 page tall? Can this be set with VBA? I tried to make a marcro but it crashes. This is for Excel 2002.

View 9 Replies View Related

Retrieving Color Settings

Jan 30, 2007

Is there an easy way to print out the Red Green and Blue settings (i.e. numerical values) for the current pallette in a workbook?

I can set them fine and transfer them between workbooks but that's not quite what I need.

View 3 Replies View Related

Clear Find Settings

Apr 2, 2007

In microsoft word you can clear find criteria like below.

With Selection.Find
.clearformatting
.Replacement.clearformatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With

View 8 Replies View Related

Set Print Settings Per Worksheet

Mar 6, 2008

At my company we need to print our workbooks containing 3 to 24 worksheets. The first page should be printed on different paper than the other pages. From various forums I gathered that it's not possible to set the papertray using vba. Those forums suggest 3 things: 1. Windows Api functions (don't work at our company(security)), 2. SendKeys (don't work because of different printers, office versions and future-proofness) and 3.

Define printerdrivers per tray.

This last I did, so there are printerdrivers for tray3 and tray4.

With the following code I try to print the workbook:

Public Sub printSheets(strP1 As String, strP2 As String)
Dim curPrinter As String, firstPage As Worksheet, otherSheet As Worksheet, x As Integer
Set firstPage = Application. ActiveWorkbook.Sheets(1)
curPrinter = Application.ActivePrinter

Application.ActivePrinter = strP1
firstPage.PrintOut

The problem: The sheets are sent to the printers specified as strP1 and strP2, but the tray-settings from these printers are "overruled" by Excel; they are printed from the papertray that was the default of the printer when Excel was started.

Also, using the default printer dialog from Excel has the same problem; when the (windows-)default printer is Tray3 then all the pages come from there, even when printer Tray4 is selected as the printer. In Word or Acrobat etc the prints come from the right tray.

View 3 Replies View Related







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