A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Capturing BottomRightCell in a Variable



 
 
Thread Tools Display Modes
  #1  
Old July 20th 12, 07:00 AM posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Capturing BottomRightCell in a Variable

Anyone see what is wrong with this code. I'm getting an 'object required' error:

Dim r As Range
Set r = Sheet2.ChartObjects("myChart").BottomRightCell.Add ress

Seems pretty straightforward, but it won't work.

Thanks!
Ads
  #2  
Old July 20th 12, 07:58 AM posted to microsoft.public.excel.programming
Auric__
external usenet poster
 
Posts: 304
Default Capturing BottomRightCell in a Variable

usr58201 wrote:

> Anyone see what is wrong with this code. I'm getting an 'object
> required' error:
>
> Dim r As Range
> Set r = Sheet2.ChartObjects("myChart").BottomRightCell.Add ress
>
> Seems pretty straightforward, but it won't work.


..Address is a string, not a range (or any other type of object that requires
"Set"). Either do this:
Dim r As Range
Set r = Sheet2.ChartObjects("myChart").BottomRightCell

....or this:
Dim r As String
r = Sheet2.ChartObjects("myChart").BottomRightCell.Add ress

--
I expect wisdom from you. The least you can do is pretend you are wise.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Capturing current Worksheet Name as a variable Jimbob Excel Programming 3 April 4th 08 08:25 PM
Capturing a row being inserted John Excel Programming 3 June 22nd 07 02:23 PM
Capturing Time The Excelerator[_2_] Excel Programming 1 February 27th 07 02:22 PM
BottomRightCell ignores hidden cells [email protected] Excel Programming 13 September 11th 06 03:38 PM
Capturing Decimal Values in Variable - Losing decimals when summin Mark Excel Programming 1 September 14th 05 05:26 PM


All times are GMT +1. The time now is 01:10 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2004-2013 ExcelBanter.
The comments are property of their posters.