Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
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.
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
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 06: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"