Looking for help with macros and chart making.
From: mike drav (mikedrav_at_discussions.microsoft.com)
Date: 01/26/05
- Next message: Ed: "Help finding error setting range to Visible Cells"
- Previous message: gavim francis: "Re: Comparing data columns"
- Next in thread: Tom Ogilvy: "Re: Looking for help with macros and chart making."
- Reply: Tom Ogilvy: "Re: Looking for help with macros and chart making."
- Reply: Don Guillett: "Re: Looking for help with macros and chart making."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 26 Jan 2005 08:37:19 -0800
My spreadsheet: Rows A thru BU, Columns 1 thru 34. Keeps tracks of stats.
What I'm trying to do: I want the user to be able to click a button (or a
hotkey) to create a chart that will show a columns data so that they can
visualy see the evolution of a particular stat.
Where I currently stand: I can accomplish this with a macro but only for one
column. Here's my code...
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 1/26/2005 by
'
'
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("December 2004").Range( _
"B4:B34,J4:J34"), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="December 2004"
ActiveChart.HasLegend = False
End Sub
Is there a way to change 'ActiveChart.SetSourceData Source:=Sheets("December
2004").Range("B4:B34,J4:J34"), PlotBy:=xlColumns' so that instead of a static
range it uses where ever cell the user has selected to generate the chart?
What I want exactly is for the user to be able to point at say B4 and then
start a macro which will create a chart like i made above using a range of
B4:B34. But, if the user selects C4 I want a chart to be made with a range of
C4:C34. I am very much a beginner at coding in Excel and not sure how to
accomplish this.
Any help would be much appriciated!
-mike
- Next message: Ed: "Help finding error setting range to Visible Cells"
- Previous message: gavim francis: "Re: Comparing data columns"
- Next in thread: Tom Ogilvy: "Re: Looking for help with macros and chart making."
- Reply: Tom Ogilvy: "Re: Looking for help with macros and chart making."
- Reply: Don Guillett: "Re: Looking for help with macros and chart making."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|