473,387 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

VB/Excel: Aligning primary and secondary axes

41
Hi guys,

I was wondering if there was a way to automatically scale either axis depending on which axis has the larger range. For example, if the primary axis automatically ranges between 10 and -10, and the secondary ranges between 15 and -5... the macro should automatically scale both axes to

min = -10
max = 15

The reason for this is because I am generating some graphs (2 different chart types) automatically on BOTH axes, but I want them to overlap on the "0" value. Thanks in advance.
Sep 4 '07 #1
2 2166
cloh
41
Also as a follow-up, is there a way to programmatically fix the size of the chart?
i.e. if I want a chart 5 inches by 3 inches (or in pixels, it does not matter)

Thanks for the help!
Sep 4 '07 #2
cloh
41
In case anyone looks at this thread, after fiddling around with VB, I found that if you type in

Sheets(Sheetname).ChartObjects.Add _
(left:=left, top:=top, width:=width, height:=height)

and specify the values for the dimensions, you can set the size of your resulting chart.
Sep 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Randall Arnold | last post by:
I'm converting a vbscript program to vb.net. Witht he exception of .net idiosyncrasies, most of it is working well with the same code. My only problem is that some properties and methods are...
0
by: JonathanParker | last post by:
Hello, Wondered if you could help me with a little issue I'm having. I'm exporting some data from Access to Excel and converting into some fancy graphs. The number of series' ranges from 2 to 5....
3
by: implicate_order | last post by:
Greetings, I'm new to python and am in the process of writing a script to parse some CSV data, spread it across multiple Excel worksheets and then generate charts. I searched the internet to...
0
by: madhatter84gn | last post by:
I am trying to automate an excel spreadsheet and then create a chart. Dim chartRange As Excel.Range If rollup Then chartRange = sheet.Range("O2:Q14", Type.Missing) ...
0
by: AlexNunley | last post by:
I am trying to dump data from an access query into excel so I can pretify it. I found sample code from an old access 97 book (The version of access in use)and tinkered it into working. Well sort...
8
by: j2flk1234 | last post by:
Hi, I have a chart that I created in excel through VB. I want to try and change the font name from Times New Roman to Symbol. I tried recording the macro in excel but when I use the code in VB...
1
by: sitko | last post by:
Hi, I'm trying to create a chart in VBA in an excel sheet. When I manually create it, it creates it just find, but for some reason, when I try to automate its creation, it doesn't include both...
2
by: DaveD170 | last post by:
Hi everybody, I'm newbie in c# and I'm having trouble in creating an excel chart. I have vector of data that my program calculated. It's in the next format: X Y 0.1 100 0.2 90...
1
by: Ally | last post by:
Hi all, I’m looking to plot charts in Excel from python. After some Googling I’ve found the following code: def plot(x, y, xAxisLog=False, yAxisLog=False): # acquire application object, which...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.