Hi all,
I'd like to write a macro in for excel to create automatically a chart, i have no experience in this field.
I use the following code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8-6-2006 by CTW
'
' Keyboard Shortcut: Ctrl+m
'
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R1C1:R2C1"
ActiveChart.SeriesCollection(1).Values = "=Sheet1!R1C2:R2C2"
End Sub
This code works well, but i want the following to do:
every time pressing Ctrl+m I want the used data for the chart move 2 rows below, so I can visually scroll through the data.
for example:
Ctrl+m gives chart of:
x value: Sheet1!R1C1:R2C1"
y value: Sheet1!R1C2:R2C2"
next time pressing Ctrl+m gives chart of:
x value: Sheet1!R3C1:R4C1"
y value: Sheet1!R3C2:R4C2"
next time pressing Ctrl+m gives chart of:
x value: Sheet1!R5C1:R6C1"
y value: Sheet1!R5C2:R6C2"
etc.
How do I program this in a macro I need it for my study, I'am a student civil engineering on the university of Twente, Netherlands.
Tnxs!!
Erik Houtriet.