LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Variable Range to Create Chart From

I've been working on creating Macros to create charts based on a variable set
of data. The data is entered on a monthly basis and new charts are created
based on the new range. In the Macro that I've pasted the beginning of below
the first thing that I am doing is selecting the greatest possible range then
minimizing that to just the cells with data in them. Those are the values I
am plotting. The problem I am having is selecting the x axis labels that
correspond to the actual data that is being charted. This code works fine as
long as the data starts in the first column possible but it won't happen that
way. This is the first macro that I've attempted so please make it as simple
as possible.

TIA

Sub CompeltedAccurateWP()
'
' CompeltedAccurateWP Macro
'

'
Range("E11:AN13").Select
Selection.SpecialCells(xlCellTypeConstants, 23).Select
Range1 = Selection.Address
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("Data Input
sheet").Range(Range1) _
, PlotBy:=xlRows
ActiveChart.SeriesCollection(1).XValues = "='Data Input
sheet'!R10C5:R10C40"
ActiveChart.SeriesCollection(1).Name = "='Data Input sheet'!R11C2"
ActiveChart.SeriesCollection(2).XValues = "='Data Input
sheet'!R10C5:R10C40"
ActiveChart.SeriesCollection(2).Name = "='Data Input sheet'!R12C2"
ActiveChart.SeriesCollection(3).XValues = "='Data Input
sheet'!R10C5:R10C40"
ActiveChart.SeriesCollection(3).Name = "='Data Input sheet'!R13C2"
ActiveChart.Location Whe=xlLocationAsNewSheet, Name:= _
"CompletedAccurateWP"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Complete and Accurate Work Packages "
& Chr(1) & "As Rated By Project Team (Scale 1-10)"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Date"
.Axes(xlValue, xlPrimary).HasTitle = False
' .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Scale (1-10)"
End With

 
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
Variable Range to be used in a chart Jeff Excel Worksheet Functions 1 February 9th 07 03:22 AM
Variable range chart Nikki Excel Discussion (Misc queries) 4 October 20th 06 08:07 PM
Variable Range/chart ballyb Excel Programming 1 June 12th 06 06:55 PM
how to create a three variable chart. [email protected] Charts and Charting in Excel 2 May 24th 06 12:28 AM
Excel VBA-Change chart range to variable waveracerr[_10_] Excel Programming 1 February 11th 04 04:39 PM


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

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

About Us

"It's about Microsoft Excel"