ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   General reference source (https://www.excelbanter.com/excel-discussion-misc-queries/199183-general-reference-source.html)

Ruben

General reference source
 
I need a macro code for a general sheet reference to a single column. In my
excel file I have about 15 sheets. In every sheet I would like to make a
graph of the same colum (F column). It should be possible to put this in a
macro, but I don't see how I can refer in my macro to the F column in a
general way for all the sheets instead of referring to a single specific
sheet. Now I have:
="=sheet2!R1C6:R108C6
This is specific (sheet2) and not general. So I think I should change
'sheet2!' in a general definition. Then the macro will use this source for
making a graph on all my 15 sheets. Thanks for helping me!

Dave Peterson

General reference source
 
I'm not quite sure what you're doing, but you may be able to use:

Dim myRng as range
dim wks as worksheet
for each wks in thisworkbook.worksheets
set myrng = .range("F1",.cells(.rows.count,"F").end(xlup))
your code here to create the chart for each sheet???
... = myrng.address(external:=true), ...

Ruben wrote:

I need a macro code for a general sheet reference to a single column. In my
excel file I have about 15 sheets. In every sheet I would like to make a
graph of the same colum (F column). It should be possible to put this in a
macro, but I don't see how I can refer in my macro to the F column in a
general way for all the sheets instead of referring to a single specific
sheet. Now I have:
="=sheet2!R1C6:R108C6
This is specific (sheet2) and not general. So I think I should change
'sheet2!' in a general definition. Then the macro will use this source for
making a graph on all my 15 sheets. Thanks for helping me!


--

Dave Peterson

Ruben

General reference source
 
Thank you very much for your reaction!

Ruben


"Dave Peterson" wrote:

I'm not quite sure what you're doing, but you may be able to use:

Dim myRng as range
dim wks as worksheet
for each wks in thisworkbook.worksheets
set myrng = .range("F1",.cells(.rows.count,"F").end(xlup))
your code here to create the chart for each sheet???
... = myrng.address(external:=true), ...

Ruben wrote:

I need a macro code for a general sheet reference to a single column. In my
excel file I have about 15 sheets. In every sheet I would like to make a
graph of the same colum (F column). It should be possible to put this in a
macro, but I don't see how I can refer in my macro to the F column in a
general way for all the sheets instead of referring to a single specific
sheet. Now I have:
="=sheet2!R1C6:R108C6
This is specific (sheet2) and not general. So I think I should change
'sheet2!' in a general definition. Then the macro will use this source for
making a graph on all my 15 sheets. Thanks for helping me!


--

Dave Peterson



All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com