Use Macro choose a graph??

jtanium

New member
Local time
Today, 10:29
Joined
Nov 5, 2007
Messages
2
How can I use Macro for choose a graph ??,A graph are generate by MS Excel.
 
Howdy, and welcome to the board.

Are you wanting the dialog box to appear that shows the chart choices?

Code:
Sub Test()
    Charts.Add
    ActiveChart.ChartType = xlLine
    ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("B1:E5")
End Sub
Now, if you want the whole list of possibilities, when you are in VBE and have this code (with Auto List Members checked in Tools > Options > Editor (Tab) ), then delete xlLine, and it will bring up the possible choices.

Another option, but far less satisfactory is to develop a UserForm with the chart choices. But there are so many choices, it would be more cumbersome, and frustrating for the user, and a lot more work for you.
________
Hero honda hunk history
 
Last edited:
Thanks so much.I' a beginner to use Macro.

This is a sheet that I need to make.Following picture.

6.jpg


*column A is a ref of combobox and A1 is a sheet "A1"(In this sheet has one graph)

A2 is a sheet "A2"
A3 is a sheet "A3"
etc.

All sheets are have many of data to generate a graph.
 
Last edited:
Can you expand and include an example workbook with what you expect to see?

Are these charts pre-built? Or are you wanting to build them on the fly? Will the data source change size (i.e. more rows/columns)?
________
MEDICAL MARIJUANA CARD
 
Last edited:
As I look at it, it would be better not to have worksheets named with cell references. It can be confusing. This might be able to be done without VBA. But I don't know enough to determine that yet.
________
Suzuki fxr150 specifications
 
Last edited:

Users who are viewing this thread

Back
Top Bottom