Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ML ML is offline
external usenet poster
 
Posts: 57
Default How to set range for charts?

I am creating automatic charts to be updated on a weekly basis by simply
recording the macros while creating them in Excel and then run the macro
every week to update the charts.

I have a range that can be either week 1-52 (full year) or rolling over 52
weeks (from August to August for example).

How do i set the range based on current date i.e. I do not want to show the
remaining weeks of the year empty as it affect trend lines??


  #2   Report Post  
Posted to microsoft.public.excel.programming
ML ML is offline
external usenet poster
 
Posts: 57
Default How to set range for charts?

i.e how can I avoid having a set range below to be from E to BC and instead
be from E to x (something I define)?

Sub Macro1()
'
' Macro1 Macro
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("1st cut from pivot").Range( _
"E13:BC13,E19:BC19,E28:BC28"), PlotBy:=xlRows
ActiveChart.Location Whe=xlLocationAsNewSheet, Name:="Chart1"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.SeriesCollection(3).Select
ActiveChart.SeriesCollection(3).Trendlines.Add(Typ e:=xlLogarithmic,
Forward _
:=0, Backward:=0, DisplayEquation:=False,
DisplayRSquared:=False).Select
ActiveChart.SeriesCollection(3).Select
ActiveChart.SeriesCollection(3).Trendlines.Add(Typ e:=xlLogarithmic,
Forward _
:=0, Backward:=0, DisplayEquation:=False,
DisplayRSquared:=False).Select
Selection.Delete
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Trendlines.Add(Typ e:=xlLogarithmic,
Forward _
:=0, Backward:=0, DisplayEquation:=False,
DisplayRSquared:=False).Select
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).Trendlines.Add(Typ e:=xlLogarithmic,
Forward _
:=0, Backward:=0, DisplayEquation:=False,
DisplayRSquared:=False).Select
End Sub

"ML" wrote:

I am creating automatic charts to be updated on a weekly basis by simply
recording the macros while creating them in Excel and then run the macro
every week to update the charts.

I have a range that can be either week 1-52 (full year) or rolling over 52
weeks (from August to August for example).

How do i set the range based on current date i.e. I do not want to show the
remaining weeks of the year empty as it affect trend lines??


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
Using Range Names in Charts Eli Kedar Charts and Charting in Excel 3 October 19th 08 01:57 PM
Range Names in Excel Charts forest8 Charts and Charting in Excel 1 February 18th 08 09:46 AM
Range Names with Charts ArthurJ Charts and Charting in Excel 3 June 6th 05 06:49 PM
Charts Range Setting Nigel Excel Programming 6 May 4th 05 05:27 PM
Auto x range start value, xy charts [email protected] Charts and Charting in Excel 5 January 24th 05 11:49 PM


All times are GMT +1. The time now is 12:01 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"