Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 762
Default Urgent help on plotting a X,Y graph...

Shyju -

I don't have the time to examine your code or to give you step by step
methods, but I do have example unprotected VBA code available in the Better
Histogram add-in that you can download from www.treeplan.com. The histogram
uses a column chart type with an XY (Scatter) chart type, and there are
separate VBA modules for Excel 97-2003 and Excel 2007.

- Mike
www.MikeMiddleton.com

"SPV" wrote in message
ups.com...
Hi All,
I do some analysis on my excel sheet and I will get the range of
values need to be plotted on Excel..
So I have to plot a graph with columns Column_X, Column_Y1 and
Column_Y2 and Row range as Row_start and Row_end.

Al these above variables are declared as integeres.

Lets assume
Column_X =1(A), Column_Y1=2 (C) and Column_Y2=6(F)
Row_start= 10 , Row_end =25

If I specify the range in absolute way it will be,

Range("A10:A25,C10:C25,F10:F25").Select

Can anybody tell me how can I do the same in with row and column
numbers?

I have tried in two ways.

1. Using the Range approch
-------------------------------------------


Dim X_axis As Range
Dim Value_Y1 As Range
Dim Value_Y2 As Range


Set X_axis = ActiveSheet.Range(Cells(Row_start, Column_X ),
Cells(Row_end, Column_X ))
Set Value_Y1= ActiveSheet.Range(Cells(Row_start, Column_Y1),
Cells(Row_end, Column_Y1))
Set Value_Y2=ActiveSheet.Range(Cells(Row_start, Column_Y2),
Cells(Row_end, Column_Y2))


Range(X_axis, Value_Y1, Value_Y2).Select = didn't work for me..
Range("X_axis, Value_Y1, Value_Y2").Select = didn't work for me..

Is there any way to select different column range ?

2. Using Cells() approach
-------------------------------------

This also didn't work for me...
I was trying to emulate "Range("A10:A25,C10:C25,F10:F25").Select"
with

Range((Cells(Row_start, X_Axis):Cells(Row_end, X_Axis)) ,
(Cells(Row_start, Value_Y2):Cells(Row_end, Value_Y1)),
(Cells(Row_start,ValueY2):Cells(Row_end,ValueY2))) .Select


I am a newbie in excel .. Your inputs will be appreciated....


Please find the macro that uses the absolute reference to plot the
graph. I have to change absolute reference with the calculated value
of row and column

Charts.Add
ActiveChart.ChartType = xlXYScatterSmooth

ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range( _
"A2:A14,E2:E14,H2:H14"), PlotBy:=xlColumns

ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "ARM Load"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Time
in Sec"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Load in
%"
End With


Again...
With out specifying Sheet name how can I add the chart object.. May be
aurrent activated sheeet ? What is the syntax?





Regards,
Shyju



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
Co-ordinates plotting on Graph //sk sansk_23 Charts and Charting in Excel 1 March 27th 09 12:10 PM
Help! Plotting to scatter graph katem[_2_] Excel Programming 7 June 18th 07 01:20 PM
Plotting a Graph Mayank Excel Discussion (Misc queries) 2 June 9th 06 08:12 PM
Plotting graph directly onto the cells DaveCKW Excel Discussion (Misc queries) 1 September 7th 05 01:10 AM
Graph plotting Dovla Excel Programming 0 September 9th 04 02:05 PM


All times are GMT +1. The time now is 06:29 AM.

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"