Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Referencing cells in a loop

Hi,
I am trying to generate automatically some graphs with a
macro, but I cannot find how to reference the cells.

What I want to do is to copy the graph, and then to change
the "source data". I have 20 graphs to do, so I need to
increment the row number.

Here is the macro for 1 graph:

Sub Macro2()
Sheets("Chart1").Select
Sheets("Chart1").Copy Befo=Sheets(2)
Sheets("Chart1 (2)").Select
Sheets("Chart1 (2)").Name = "Chart2"
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).Values = _
"=(Sheet1!R26C2,Sheet1!R7C3,Sheet1!R7C5,Sheet1 !
R7C7)"
ActiveChart.SeriesCollection(1).Name = "=""titi-2"""
End Sub


What I need to do is to vary R7 from R7 to R26. (and chart
2 form 2 to 22)

I already tried with "Rj" or cells(j,7), but nothing seems
to work!

Thanks for your help.

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
Loop through cells Sheeny[_2_] Excel Programming 7 May 6th 04 12:02 AM
linked cells loop? Tom Ogilvy Excel Programming 3 April 2nd 04 09:56 PM
linked cells loop? Tom Ogilvy Excel Programming 0 April 2nd 04 05:36 PM
HOW-TO? Loop through cells in a column Mr. Clean[_2_] Excel Programming 4 December 12th 03 08:28 PM
VBA loop cells Adrie Rahanra Excel Programming 1 September 30th 03 10:22 AM


All times are GMT +1. The time now is 02:05 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"