Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.charting
|
|||
|
|||
Difficulty Setting Up Excel Chart With Scroll Capabilities
I am trying to set up an excel graph that will let me scroll through a large
amount of values. I want to be able to set my range as something like A1:H501 and actually have data all the way to Row 65000. What I want to do is then have a scroll bar be manually moved and the chart update according to the new area I want charted. The Code Below is what I have tried and I keep getting errors. Any help would be appreciated. I am grabbing data from an Programmable Logic Controller and the data is spread over a 2 hour period, so I want to be able to scroll through the data. Dim LowerBound As Double Dim UpperBound As Double Dim CenterSelection As Double Dim GraphRange(5000, 32) As Single Public Sub SBarArea_Change() GetValues End Sub Public Sub GetValues() Dim OriginalArea As Range CenterSelection = Range("A46").Value LowerBound = CenterSelection - 250 UpperBound = CenterSelection + 250 MsgBox "Before Copying" OriginalArea = Range("D" & LowerBound & ":" & "K" & UpperBound) Range("M15:T515") = Range(OriginalArea) MsgBox "After Copying" LowerBound = 0 UpperBound = 0 End Sub It Appears that excel doesn't like me making my data in OriginalArea dynamic. Any help would be appreciated, Dave Marden |
#2
Posted to microsoft.public.excel.charting
|
|||
|
|||
Difficulty Setting Up Excel Chart With Scroll Capabilities
Hi,
Try this revised code. Public Sub GetValues() Dim OriginalArea As String CenterSelection = Range("A46").Value LowerBound = CenterSelection - 250 UpperBound = CenterSelection + 250 MsgBox "Before Copying" OriginalArea = _ Range("D" & LowerBound & ":" & "K" & UpperBound).Address Range("M15:T515") = Range(OriginalArea).Value MsgBox "After Copying" LowerBound = 0 UpperBound = 0 End Sub You might find the Named range approach easiser. No code required. http://peltiertech.com/Excel/Charts/Dynamics.html Cheers Andy Dave Marden wrote: I am trying to set up an excel graph that will let me scroll through a large amount of values. I want to be able to set my range as something like A1:H501 and actually have data all the way to Row 65000. What I want to do is then have a scroll bar be manually moved and the chart update according to the new area I want charted. The Code Below is what I have tried and I keep getting errors. Any help would be appreciated. I am grabbing data from an Programmable Logic Controller and the data is spread over a 2 hour period, so I want to be able to scroll through the data. Dim LowerBound As Double Dim UpperBound As Double Dim CenterSelection As Double Dim GraphRange(5000, 32) As Single Public Sub SBarArea_Change() GetValues End Sub Public Sub GetValues() Dim OriginalArea As Range CenterSelection = Range("A46").Value LowerBound = CenterSelection - 250 UpperBound = CenterSelection + 250 MsgBox "Before Copying" OriginalArea = Range("D" & LowerBound & ":" & "K" & UpperBound) Range("M15:T515") = Range(OriginalArea) MsgBox "After Copying" LowerBound = 0 UpperBound = 0 End Sub It Appears that excel doesn't like me making my data in OriginalArea dynamic. Any help would be appreciated, Dave Marden |
#3
Posted to microsoft.public.excel.charting
|
|||
|
|||
Difficulty Setting Up Excel Chart With Scroll Capabilities
Thanks Andy, That was a big help.
Dave "Andy Pope" wrote in message ... Hi, Try this revised code. Public Sub GetValues() Dim OriginalArea As String CenterSelection = Range("A46").Value LowerBound = CenterSelection - 250 UpperBound = CenterSelection + 250 MsgBox "Before Copying" OriginalArea = _ Range("D" & LowerBound & ":" & "K" & UpperBound).Address Range("M15:T515") = Range(OriginalArea).Value MsgBox "After Copying" LowerBound = 0 UpperBound = 0 End Sub You might find the Named range approach easiser. No code required. http://peltiertech.com/Excel/Charts/Dynamics.html Cheers Andy Dave Marden wrote: I am trying to set up an excel graph that will let me scroll through a large amount of values. I want to be able to set my range as something like A1:H501 and actually have data all the way to Row 65000. What I want to do is then have a scroll bar be manually moved and the chart update according to the new area I want charted. The Code Below is what I have tried and I keep getting errors. Any help would be appreciated. I am grabbing data from an Programmable Logic Controller and the data is spread over a 2 hour period, so I want to be able to scroll through the data. Dim LowerBound As Double Dim UpperBound As Double Dim CenterSelection As Double Dim GraphRange(5000, 32) As Single Public Sub SBarArea_Change() GetValues End Sub Public Sub GetValues() Dim OriginalArea As Range CenterSelection = Range("A46").Value LowerBound = CenterSelection - 250 UpperBound = CenterSelection + 250 MsgBox "Before Copying" OriginalArea = Range("D" & LowerBound & ":" & "K" & UpperBound) Range("M15:T515") = Range(OriginalArea) MsgBox "After Copying" LowerBound = 0 UpperBound = 0 End Sub It Appears that excel doesn't like me making my data in OriginalArea dynamic. Any help would be appreciated, Dave Marden |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Difficulty w/ creating a chart | Excel Discussion (Misc queries) | |||
VBA for setting max value in scroll bars on charts? | Charts and Charting in Excel | |||
Excel Capabilities in Word | Charts and Charting in Excel | |||
Setting All Worksheets To The Same Scroll Position | Excel Worksheet Functions | |||
How to use just the graphing capabilities of MS Excel? | Excel Discussion (Misc queries) |