ethaneandethaneproducts
New Member
- Joined
- Jul 14, 2022
- Messages
- 21
- Office Version
- 2016
- Platform
- Windows
I have a bunch of data like is shown in the image. For each dataset (sets are titled "one", "two", "three"), I want to plot the values A, B, and % diff against the dates in column A. I don't want to keep manually editing the data selection for all 3 series each time I make a new graph, so I'm trying to understand how to write a macro to automate selecting the data depending on where on the sheet I've selected.
I'd like to be able to click in cell B2 or B3, run the macro, and have a chart pop up for dataset "one". The macro should know that $A$4:$A$21 is going to be my x-axis category for all series, regardless of dataset, but also know that because I clicked B2 (or B3, not sure if B2 being a merged cell would cause issues), I want B4:B21, C4:C21, and F4:F21 as my three series. The range will always be rows 4 to 21. Ideally, it'd also make the graph's title =B2. Likewise, if I clicked G2/3, it'd know that G, H, and K 4:21 are the three series.
Thank you!
I'd like to be able to click in cell B2 or B3, run the macro, and have a chart pop up for dataset "one". The macro should know that $A$4:$A$21 is going to be my x-axis category for all series, regardless of dataset, but also know that because I clicked B2 (or B3, not sure if B2 being a merged cell would cause issues), I want B4:B21, C4:C21, and F4:F21 as my three series. The range will always be rows 4 to 21. Ideally, it'd also make the graph's title =B2. Likewise, if I clicked G2/3, it'd know that G, H, and K 4:21 are the three series.
Thank you!