Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I was given a spreadsheet with the following columns:
a button column (to run a macro) a persons name 6 monthly columns of figures When the button is clicked the macro associated is run and a cute little chart for the row pops up. The first 3 rows have the buttons and the associated macros. My job, is to populate the macro for the rest of the 1780 rows. The code for the current Macros : Sub Button1() ActiveSheet.ChartObjects("Chart 2").Activate ActiveChart.ChartArea.Select ActiveChart.SeriesCollection(1).Values = "=Sheet1!R3C3:R3C9" ActiveChart.SeriesCollection(1).Name = "=Sheet1!R3C2" End Sub Sub Button2() ActiveSheet.ChartObjects("Chart 2").Activate ActiveChart.ChartArea.Select ActiveChart.SeriesCollection(1).Values = "=Sheet1!R4C3:R4C9" ActiveChart.SeriesCollection(1).Name = "=Sheet1!R4C2" End Sub Sub Button3() ActiveSheet.ChartObjects("Chart 2").Activate ActiveChart.ChartArea.Select ActiveChart.SeriesCollection(1).Values = "=Sheet1!R5C3:R5C9" ActiveChart.SeriesCollection(1).Name = "=Sheet1!R5C2" End Sub Maybe it's because I am a programer, but I have to believe there is an easier way of doing this. One sub that will, based upon the row of the button clicked, run for every row and create the chart. I have been searching microsoft and the rest of the web with no luck. Might be able to find something if I had a good grasp of the terminology. Thank You, Bruce |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro that will add data from multiple workbooks to the 1st open r | Excel Discussion (Misc queries) | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions | |||
How do I record a macro which should work on multiple files ? | Excel Discussion (Misc queries) | |||
Zip Code Macro | Excel Worksheet Functions | |||
Macro for multiple charts | Excel Worksheet Functions |