Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
changing selections dynamically
hello,
i am trying to set up a keyboard shortcut where i can select some cells, hit the shortcut and a graph would be build based on the selected data. so far i can do that but i can only graph data from the recorded range when i start the macro B4:J4 - i want to be able to graph from any dataset i select... Sub graph() ' Keyboard Shortcut: Ctrl+Shift+G ' Range("B4:J4").Select Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("B4:J4") ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1" End Sub thanks, |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
changing selections dynamically
try this without the
Range("B4:J4").Select ActiveChart.SetSourceData Source:=selection.address -- Don Guillett SalesAid Software wrote in message oups.com... hello, i am trying to set up a keyboard shortcut where i can select some cells, hit the shortcut and a graph would be build based on the selected data. so far i can do that but i can only graph data from the recorded range when i start the macro B4:J4 - i want to be able to graph from any dataset i select... Sub graph() ' Keyboard Shortcut: Ctrl+Shift+G ' Range("B4:J4").Select Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("B4:J4") ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1" End Sub thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamically changing print areas for Pivot Tables | Excel Discussion (Misc queries) | |||
Pivottable - dynamically changing the range of cells | Excel Discussion (Misc queries) | |||
Dynamically changing several pivot tables at once | Excel Discussion (Misc queries) | |||
Dynamically changing Border-Color of all series() to "0" | Charts and Charting in Excel | |||
Store values of a dynamically changing cell | Excel Worksheet Functions |