Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Variables and graphs

Quick question....

If I have a VBA saying

ActiveChart.SeriesCollection(1).Values = "=three!R3000C11:R4000tC11"

can I replace it with

ActiveChart.SeriesCollection(1).Values = "=three!RsetinC11:RsetoutC11"

where setin and setout are declared variables? I'm a bit hazy on the syntax
of this one.

Cheers

tp


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Variables and graphs

Try

ActiveChart.SeriesCollection(1).Values = "=three!R" & setin &
"C11:" & Rsetout & "C11"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"teepee" wrote in message
...
Quick question....

If I have a VBA saying

ActiveChart.SeriesCollection(1).Values =
"=three!R3000C11:R4000tC11"

can I replace it with

ActiveChart.SeriesCollection(1).Values =
"=three!RsetinC11:RsetoutC11"

where setin and setout are declared variables? I'm a bit hazy
on the syntax of this one.

Cheers

tp



  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Variables and graphs

I think Chip meant:

ActiveChart.SeriesCollection(1).Values _
= "=three!R" & setin & "C11:R" & setout & "C11"



Chip Pearson wrote:

Try

ActiveChart.SeriesCollection(1).Values = "=three!R" & setin &
"C11:" & Rsetout & "C11"

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"teepee" wrote in message
...
Quick question....

If I have a VBA saying

ActiveChart.SeriesCollection(1).Values =
"=three!R3000C11:R4000tC11"

can I replace it with

ActiveChart.SeriesCollection(1).Values =
"=three!RsetinC11:RsetoutC11"

where setin and setout are declared variables? I'm a bit hazy
on the syntax of this one.

Cheers

tp


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Variables and graphs

Yeah, that's what I meant. Fingers and brain weren't quite in
sync.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Dave Peterson" wrote in message
...
I think Chip meant:

ActiveChart.SeriesCollection(1).Values _
= "=three!R" & setin & "C11:R" & setout & "C11"



Chip Pearson wrote:

Try

ActiveChart.SeriesCollection(1).Values = "=three!R" & setin &
"C11:" & Rsetout & "C11"

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"teepee" wrote in message
...
Quick question....

If I have a VBA saying

ActiveChart.SeriesCollection(1).Values =
"=three!R3000C11:R4000tC11"

can I replace it with

ActiveChart.SeriesCollection(1).Values =
"=three!RsetinC11:RsetoutC11"

where setin and setout are declared variables? I'm a bit
hazy
on the syntax of this one.

Cheers

tp


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Variables and graphs


"Dave Peterson" wrote

I think Chip meant:

ActiveChart.SeriesCollection(1).Values = "=three!R" & setin & "C11:R" &
setout & "C11"


Many thanks. I think it's worked but I won't know till I've figured out how
to set this darn variable in the first place8-)
It's in a userform button on mediaplayer as an object and it goes

Private Sub CommandButton4_Click()
UserForm1.Height = 230
Dim setin As Variant
setin = ActiveWorkbook.ActiveSheet.Cells(1, 2).Value
End Sub

It's supposed to take the value of the formula in cell B2 but at the moment
it's just returning 1 for everything. 8-(

tp




  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Variables and graphs

If you want the value from B2, you need to change
ActiveWorkbook.ActiveSheet.Cells(1, 2).Value
to
ActiveWorkbook.ActiveSheet.Cells(2, 2).Value
or
ActiveWorkbook.ActiveSheet.Range("B2").Value

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"teepee" wrote in message
...

"Dave Peterson" wrote

I think Chip meant:

ActiveChart.SeriesCollection(1).Values = "=three!R" & setin &
"C11:R" & setout & "C11"


Many thanks. I think it's worked but I won't know till I've
figured out how to set this darn variable in the first place8-)
It's in a userform button on mediaplayer as an object and it
goes

Private Sub CommandButton4_Click()
UserForm1.Height = 230
Dim setin As Variant
setin = ActiveWorkbook.ActiveSheet.Cells(1, 2).Value
End Sub

It's supposed to take the value of the formula in cell B2 but
at the moment it's just returning 1 for everything. 8-(

tp




  #7   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Variables and graphs


"teepee" wrote

It's supposed to take the value of the formula in cell B2


I meant A2 of course


  #8   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Variables and graphs


"Chip Pearson" wrote

ActiveWorkbook.ActiveSheet.Cells(2, 2).Value
or
ActiveWorkbook.ActiveSheet.Range("B2").Value


No still getting a 1 value.It's almost as though it won't accept a value
from a userform button on wmp when it is an active object.


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
Summing graphs without differnt independent variables Sebastian Stormbo Charts and Charting in Excel 5 July 18th 08 05:12 PM
2-4 stacked bar graphs, two variables each, Y's vary same chart Writer on Path Charts and Charting in Excel 1 October 22nd 07 08:11 PM
automatically updating graphs based upon conditional variables GGC Charts and Charting in Excel 2 June 22nd 06 01:31 PM
Automatic Graphs/ Dynamic Graphs DanielWalters6 Charts and Charting in Excel 1 January 24th 06 09:29 PM
Variables and graphs teepee Excel Discussion (Misc queries) 7 January 2nd 06 11:47 PM


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