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: 14
Default Graph Macro range question

Is there a way to select a range of cells ONLY if they have data in them
while creating a graph macro. Here is the code I have as of right now:

Sub Try1()
Sheets("Raw Data").Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("Raw Data").Range("C252:C256"), _
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsNewSheet, Name:="AHT Graph"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub

Where is says .Range("C252:C256") works this week, but the problem starts in
future weeks. Each week when I add data to my sheet it will add a new number
to the end of that range (I.E. C256 next week) If I just set my range to
C252,C352 then the usable portion of my grid is smashed all the way to the
left with 90 (or so) blank (0, null, what ever you want to call it) plots on
the line graph. This makes it unreadable. What I would like to do is make
my range change as data is added. This macro is tied to a button in excel so
that it can be ran only if need be and will not need to be there all of the
time. Might sound trivial but for as many graphs as I want to make it really
will help out with file size.
 
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
graph range update from macro rick_mc Excel Programming 0 March 28th 07 04:10 PM
Trying to define a range for a graph dynamically within a macro jb Excel Programming 3 March 21st 07 08:36 PM
Macro for Graph - problem with Range Tanya Excel Programming 2 March 3rd 07 09:37 PM
Graph macro question Edwin Merced Excel Programming 4 December 5th 03 06:06 PM


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