Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default dynamic range

hi,

i have the following:

Dim NewGraphSource As String
Dim testRange As Range
testRange = NewGraphSource
MsgBox "testrange: " & testRange
ActiveSheet.ChartObjects("Chart 7").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:=Sheets("Trending").Range(testRange) _
, PlotBy:=xlRows


lets just say that NewGraphSource = A14:G14

i am getting an error message:
"runtime error 91: object variable or With block variable not set"

i am not sure what to do.

thanks in advance,
geebee


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default dynamic range

You are very close:

Dim NewGraphSource As String
Dim testRange As Range
NewGraphSource = "A14:G14"
Set testRange=Range(NewGraphSource)
--
Gary''s Student - gsnu200774


"geebee" wrote:

hi,

i have the following:

Dim NewGraphSource As String
Dim testRange As Range
testRange = NewGraphSource
MsgBox "testrange: " & testRange
ActiveSheet.ChartObjects("Chart 7").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:=Sheets("Trending").Range(testRange) _
, PlotBy:=xlRows


lets just say that NewGraphSource = A14:G14

i am getting an error message:
"runtime error 91: object variable or With block variable not set"

i am not sure what to do.

thanks in advance,
geebee


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
dynamic range based on criteria, within a dynamic range, passed to a function [email protected] Excel Programming 5 October 9th 07 10:13 PM
creating a dynamic range based on criteria, within a dynamic range, and passing it to a function [email protected] Excel Programming 0 October 9th 07 05:22 PM
getting the absolute range address from a dynamic named range junoon Excel Programming 2 March 21st 06 01:29 PM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
select dynamic range with dynamic start point Juli Excel Programming 1 August 31st 05 12:05 AM


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