Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving chart window in macro

Does anyone out there know how to move the chart window
range in a macro? I'm backtesting stock data on an
indicator I'm building, and I'd like to be able to inch
forward a day at a time.
I wrote a macro a couple of years ago that did this, but
for the life of me, I can't get anything to work now.
From what I remember, it was just a small snippet of code
(maybe 5-6 lines) and i used the activecell and offset
functions to change the range. If anyone knows how to do
this, I'd be incredibly grateful, maybe even to the point
of considering them a minor god. The ability to move both
sides of the window (1-50, then 2-51, etc.) would be
cool, but not necessary.

Thanks, Rustar
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Moving chart window in macro

Rustar,

I am taking a shot in the dark here.

I think your critical functions are offset and resize. In VBA, offset
doesn't work the same as it does in the normal spreadsheet mode. You must
use resize as you move along.

Borrowing from XL Help:

This example assumes that Sheet1 contains a table that has a header row. The
example selects the table, without selecting the header row. The active cell
must be somewhere in the table before the example is run.

Set tbl = ActiveCell.CurrentRegion
tbl.Offset(1, 0).Resize(tbl.Rows.Count - 1, _
tbl.Columns.Count).SelectSo you could just increment your offset
position?Hope this is of some value.Regards,Kevin


"Rustar" wrote in message
...
Does anyone out there know how to move the chart window
range in a macro? I'm backtesting stock data on an
indicator I'm building, and I'd like to be able to inch
forward a day at a time.
I wrote a macro a couple of years ago that did this, but
for the life of me, I can't get anything to work now.
From what I remember, it was just a small snippet of code
(maybe 5-6 lines) and i used the activecell and offset
functions to change the range. If anyone knows how to do
this, I'd be incredibly grateful, maybe even to the point
of considering them a minor god. The ability to move both
sides of the window (1-50, then 2-51, etc.) would be
cool, but not necessary.

Thanks, Rustar



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Moving chart window in macro

Rustar -

I've written an article for TechTrax e-zine which shows how to do this
in a worksheet without VBA, just using scroll bars and dynamic range
names. It will be published on the web in a week or so. Here's the
link to the current issue, from which you'll be able to find the new one
when it comes out.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Rustar wrote:
Does anyone out there know how to move the chart window
range in a macro? I'm backtesting stock data on an
indicator I'm building, and I'd like to be able to inch
forward a day at a time.
I wrote a macro a couple of years ago that did this, but
for the life of me, I can't get anything to work now.
From what I remember, it was just a small snippet of code
(maybe 5-6 lines) and i used the activecell and offset
functions to change the range. If anyone knows how to do
this, I'd be incredibly grateful, maybe even to the point
of considering them a minor god. The ability to move both
sides of the window (1-50, then 2-51, etc.) would be
cool, but not necessary.

Thanks, Rustar


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Moving chart window in macro

It looks like Jon forgot to include the link. Here's the October issue:

http://pubs.logicalexpressions.com/P...ssue.asp?ISI=0

and a link to Jon's Charting FAQ article from September:

http://pubs.logicalexpressions.com/P...cle.asp?ID=209

Jon Peltier wrote:
Rustar -

I've written an article for TechTrax e-zine which shows how to do this
in a worksheet without VBA, just using scroll bars and dynamic range
names. It will be published on the web in a week or so. Here's the
link to the current issue, from which you'll be able to find the new one
when it comes out.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Rustar wrote:

Does anyone out there know how to move the chart window range in a
macro? I'm backtesting stock data on an indicator I'm building, and
I'd like to be able to inch forward a day at a time.
I wrote a macro a couple of years ago that did this, but for the life
of me, I can't get anything to work now. From what I remember, it was
just a small snippet of code (maybe 5-6 lines) and i used the
activecell and offset functions to change the range. If anyone knows
how to do this, I'd be incredibly grateful, maybe even to the point of
considering them a minor god. The ability to move both sides of the
window (1-50, then 2-51, etc.) would be cool, but not necessary.

Thanks, Rustar





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
Moving and resizing the file window Jose Olivencia Excel Discussion (Misc queries) 0 December 4th 09 05:39 PM
Arrow Keys Moving Window Frame instead of Moving Between Cells nemmex Excel Discussion (Misc queries) 2 April 9th 07 09:08 AM
Sub-window not moving or maximizing? MTAR Excel Discussion (Misc queries) 2 February 24th 07 01:41 PM
undo split window moving at the same time mahf08085 Excel Discussion (Misc queries) 3 January 29th 07 04:36 PM
Chart Titles not showing in excel chart Window Greg_tnwre Excel Discussion (Misc queries) 0 July 15th 06 03:41 AM


All times are GMT +1. The time now is 06:00 AM.

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

About Us

"It's about Microsoft Excel"