Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default 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   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulty w/ creating a chart Jimbo[_2_] Excel Discussion (Misc queries) 1 October 17th 07 10:11 AM
VBA for setting max value in scroll bars on charts? [email protected] Charts and Charting in Excel 3 July 26th 06 10:32 PM
Excel Capabilities in Word Chicago Secretary Charts and Charting in Excel 1 September 2nd 05 05:55 PM
Setting All Worksheets To The Same Scroll Position wormdazzler Excel Worksheet Functions 2 July 20th 05 10:40 PM
How to use just the graphing capabilities of MS Excel? Christopher Blue Excel Discussion (Misc queries) 4 January 3rd 05 02:14 AM


All times are GMT +1. The time now is 12:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"