Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default making chart using macro

Hi,
i want to make a plot using macro where I want my x-axis to be the
value from the same column but random rows for example

R18C3,R19C3,R21C3,R23C3,R25C3,R27C3 ( only rows are changing)

and my Y-axis should also be something like this

R18C5,R19C5,R21C5,R23C5,R25C5,R27C5 ( only rows are changing)

For one plot It is working but i do not know how i can plot for other
columns...



the code looks like this

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 3/30/2007 by Roger
'
' Keyboard Shortcut: Ctrl+m
'
Charts.Add
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = _
"=('UV and UV & Ozone'!R18C3,'UV and UV & Ozone'!R19C3,'UV and
UV & Ozone'!R21C3,'UV and UV & Ozone'!R23C3,'UV and UV & Ozone'!
R25C3,'UV and UV & Ozone'!R27C3)"
ActiveChart.SeriesCollection(1).Values = _
"=('UV and UV & Ozone'!R18C37,'UV and UV & Ozone'!R19C37,'UV
and UV & Ozone'!R21C37,'UV and UV & Ozone'!R23C37,'UV and UV & Ozone'!
R25C37,'UV and UV & Ozone'!R27C37)"
ActiveChart.SeriesCollection(1).Name = "=""UV"""
ActiveChart.SeriesCollection(2).XValues = _
"=('UV and UV & Ozone'!R18C3,'UV and UV & Ozone'!R19C3,'UV and
UV & Ozone'!R21C3,'UV and UV & Ozone'!R23C3,'UV and UV & Ozone'!
R25C3,'UV and UV & Ozone'!R27C3)"
ActiveChart.SeriesCollection(2).Values = _
"=('UV and UV & Ozone'!R18C37,'UV and UV & Ozone'!R20C37,'UV
and UV & Ozone'!R22C37,'UV and UV & Ozone'!R24C37,'UV and UV & Ozone'!
R26C37,'UV and UV & Ozone'!R28C37)"
ActiveChart.SeriesCollection(2).Name = "=""UV & Ozone"""
ActiveChart.Location Whe=xlLocationAsObject, Name:="UV and UV &
Ozone"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "plot"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"time"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "MPN"
End With
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
making chart using macro roger Excel Discussion (Misc queries) 0 March 30th 07 04:45 PM
Making a chart How do i make a chart Charts and Charting in Excel 2 January 8th 07 01:54 PM
making a chart p-nut Excel Discussion (Misc queries) 1 November 15th 06 06:10 AM
Chart making Arun Bhadoria Charts and Charting in Excel 1 May 12th 05 06:05 PM
Making a chart Devin Charts and Charting in Excel 0 April 28th 05 12:50 AM


All times are GMT +1. The time now is 04:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"