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)
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.
I've created a shared spreadsheet with multiple sheets. All the content was created to be visible without having to scroll at 87%. My question is can I protect or lock the zoom level so that when anyone else opens the spreadsheet, it will only be visible at 87%? I have my screen resolution at "Smallest" so not sure if that too will affect the viewing level.
I'm looking for a code to have all the sheets in my workbook scroll together and adjust their zoom level. For example, if I zoom to 70% on Sheet 1 and scroll down to display cell J93 in the bottom left corner, I would like Sheet 2 to also be at 70% and have J93 be at the bottom left corner when I click on it.
Preferably, I would like for the sheets to adjust accordingly only when I click on them and for the macro not to have to loop through each one whenever I change one sheet (my workbook has 52 sheets for weeks of the year, plus summary sheets, so it would be very draining for it to loop through each).
I've already found a macro to have the scroll match across sheets as I adjust and click on them, but I was hoping for a code that would incorporate synchronized zoom into it as well.
I am struggling to get a macro code for zooming in and out the shapes. I have a macro which fulfill half of my requirement. By assigning the below macro to the shape I am able to increase the current size to double by clicking on the shape however I need the same macro should retain the original size upon second click.
Here is my code to increase the size.
[Code] .....
"The requirement: Once after assigning the macro, on first click it should double the shape size and on second click it should retain the original size."
I know you can predefine the level of zoom you want by using the ActiveWindow.Zoom control. I'm trying to find some code to Zoom in by a particular percentage. For example +10% zoom, so if you are currently on 90%, excel zooms to 100%, click again and then get a zoom of 110%.
Im trying to create shapes Rectangles and Squares with different colours within an excel sheet, where the length and height of the shapes is generated by input values.
Also is it possible to create 3D shapes, again where the size of the shap is generated by input cell values.
I have made a workbook file which is a form. I deleted all tool bars except "Print" and "save as". And I have saved this workbook. When I startup XL again to do other work It brings up my same bar arangement as my form. When I change it back it also changes my form file. How do I keep my form arrangement seperate from the standerd excel set up?
If cell BE72 says "Natural", then cell CM11 equals the value in cell BE73. If cell BE72 says "Deflection", then cell CT11 equals the value in cell BE73. If cell BE72 says "Dodge", then cell DA11 equals the value in cell BE73. If cell BE72 says "Insight", then cell DH11 equals the value in cell BE73. If cell BE72 says "Luck", then cell DO11 equals the value in cell BE73. If cell BE72 says "Sacred", then cell DV11 equals the value in cell BE73. If cell BE72 says "Compet.", then cell EC11 equals the value in cell BE73. But, If nothing is entered in BE72, then I want to be able to type my own values in cells CM11 through EC11 without overwriting any formula.
Since I cannot have a formula in a cell and still type in it without overwriting the formula, I was wondering if it's possible to have another cell (maybe cell A1) that has this formula in it. Can a cell like A1 hold a formula that functions for other cells even though nothing happens in A1? If so, how would I make the above work?
I have my raw data in one Worksheet and have made multiple pivot tables based off this data. Since I needed to have the same calculated fields in all these Pivot Tables, I used to simply duplicate the pivot table sheet and edit the pivots to create a new table.
Now, I'm trying to create a new pivot table from scratch, by selecting the base data table and going to "Insert Pivot Table". However I see the same Calculated Fields and upon removing, the field is removed from all other Pivot Tables.
I built a web form interface which I use to adjust orders on a web-based system our company uses.
The code I have looks at a sheet, checks if the line needs adjusted, makes adjustments as needed, and then clicks a box for lines needing ordered.
Here is the code I use:
Sub Adjustorder() Application.ScreenUpdating = False Dim ie As Object t = ThisWorkbook.Sheets("Adjust").Range("C3").Value 'checks for valid orders to adjust If t = 0 Then MsgBox ("No Skus to add"): Exit Sub Set ie = CreateObject("InternetExplorer.Application") With ie
This all works fine, but the amount of lines can be anywhere from 1 to 11,000. The fewer the amount of lines needed to loop through, the faster it does each line. With 11,000 lines it took nearly 1 second per line. With 200 lines it took 2 seconds for all of them.
I have a macro that takes a worksheet and copies it to another workbook. It works, but the graph that is contained in the new worksheet ends up a little screwy; for instance, the Plot Area is larger than it should be (height-wise along the screen), and the chart's legend isn't in the exact same place as in the original chart.
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.
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.
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?
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.
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
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?
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.
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.
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)
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.
If I send a workbook out with the zoom set at 90...will the zoom be at 90 when others open it.? Also, is there a worksheet event that I could insert to force a specific worksheet to always open with the zoom at 90??
How do i change the default zoom that excel views documents? Whatever view the last person saved the file as it opens in that zoom. I want it to open 75% zoom no matter what anyone saved the files as.
I have a sub that copies worksheet to a different blank sheet in a different work book. Is there a way for me to set the zoom value on the 2nd sheet (the one being copied to) the same as the 1st sheet?
I have just run into the situation where some users, magically and overnight , have widescreen monitors. This means the screen designs for 4:3 monitors show way too much on 16:9 monitors. I would like to put a control button on the opening page that gives them a choice of zoom, which usually seems to be 100% and 135%.
I'm thinking probably an IF sequence to parse their response and execute the appropriate zoom. But how can I make it effective for all the sheets in a workbook?
I could need a code (WS code I assume) that open the sheet in 70% zoom every time I open that sheet. For now I get in 75% every time I open it. I guess that WS code will bypass that default setting, or bug, or what ever resets it 75%.