Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using variables to set ranges

is it possible to use a variable to set a range such as I
am trying to do here?

ChartNames = Range("'DataCollection'!A1503:BR1503")
SeriesRanges = Range("'DataCollection'!A1505:BR1505")
Sheets("DataCollection").Select
Charts.Add
With ActiveChart
.ChartType = xlLineMarkers
.SetSourceData Range(SeriesRanges(1, 1)),
PlotBy:=xlColumns
.SeriesCollection(1).XValues = Range
("SeriesCollection")
.SeriesCollection(1).Name = "=DataCollection!R1C5"
.Location Whe=xlLocationAsNewSheet,
Name:=ChartNames(1)

ChartNames is just Names, but SeriesRanges are Ranges. I
want to be able to assign ranges in this manner because
then i can use a for/next loop to assign multiple ranges
which change frequently.

Thanks,
Dave Marden


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using variables to set ranges


yes it is possible



SeriesRanges = Range("'DataCollection'!A1505:BR1505")

try


strCol = "BR"
intRow = 1505


SeriesRanges = Range("'DataCollection'!A1505:" & strCol & intRow

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
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
counting ranges with multiple variables GAIDEN Excel Worksheet Functions 2 October 3rd 08 04:26 PM
Not at all clear on use of variables and/or object variables JMay-Rke Excel Discussion (Misc queries) 11 July 4th 08 06:36 PM
COUNTIF() With multiple ranges and variables Thansal Excel Discussion (Misc queries) 3 July 12th 06 05:32 PM
Using variables in Chart Ranges [email protected] Charts and Charting in Excel 1 May 9th 06 12:56 AM
Cell Variables and Ranges jcottam Excel Discussion (Misc queries) 2 March 31st 06 07:33 PM


All times are GMT +1. The time now is 05:32 AM.

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"