Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2006

Tip: Looking for answers? Try searching our database.

Variables and graphs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
teepee - 02 Jan 2006 22:50 GMT
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
Chip Pearson - 02 Jan 2006 22:53 GMT
Try

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

Signature

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

> Quick question....
>
[quoted text clipped - 14 lines]
>
> tp
Dave Peterson - 02 Jan 2006 23:02 GMT
I think Chip meant:

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

> Try
>
[quoted text clipped - 26 lines]
> >
> > tp

Signature

Dave Peterson

Chip Pearson - 02 Jan 2006 23:12 GMT
Yeah, that's what I meant. Fingers and brain weren't quite in
sync.

Signature

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

>I think Chip meant:
>
[quoted text clipped - 32 lines]
>> >
>> > tp
teepee - 02 Jan 2006 23:36 GMT
>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
Chip Pearson - 02 Jan 2006 23:38 GMT
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

Signature

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

>>I think Chip meant:
>>
[quoted text clipped - 16 lines]
>
> tp
teepee - 02 Jan 2006 23:47 GMT
> 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.
teepee - 02 Jan 2006 23:40 GMT
> It's supposed to take the value of the formula in cell B2

I meant A2 of course
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.