#1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
teepee
 
Posts: n/a
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
Chip Pearson
 
Posts: n/a
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
Dave Peterson
 
Posts: n/a
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
Chip Pearson
 
Posts: n/a
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
teepee
 
Posts: n/a
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
Chip Pearson
 
Posts: n/a
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
teepee
 
Posts: n/a
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
teepee
 
Posts: n/a
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
Multiiple graphs ageconss Charts and Charting in Excel 1 December 11th 05 07:55 PM
mutiple regression help happycow Excel Discussion (Misc queries) 1 July 30th 05 04:47 AM


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