Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Possible to select a range of cells from a Shape Object

Hello,

I was wondering if it is possible to draw a rectangle on the screen, then
determine all the cells that the rectangle is over?

I know the opposite can be done. Jon Peltier has posted code where you
select a range and then the chart resizes to that range. His code can be
found he
http://peltiertech.com/Excel/Charts/...tCreation.html

Thanks for the help.

-Rob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Possible to select a range of cells from a Shape Object

You can get the topleftcell and the bottomrightcell by using something like:

Option Explicit
Sub testme()

Dim myRect As Rectangle
With Worksheets("Sheet1")
Set myRect = .Rectangles("rectangle 1")

MsgBox myRect.TopLeftCell.Address(0, 0) & vbLf & _
myRect.BottomRightCell.Address(0, 0)
End With
End Sub



Gummy wrote:

Hello,

I was wondering if it is possible to draw a rectangle on the screen, then
determine all the cells that the rectangle is over?

I know the opposite can be done. Jon Peltier has posted code where you
select a range and then the chart resizes to that range. His code can be
found he
http://peltiertech.com/Excel/Charts/...tCreation.html

Thanks for the help.

-Rob


--

Dave Peterson
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
shape object on a userform? Alan Ibbotson Excel Programming 5 April 25th 05 01:24 PM
How to tell wich object/shape was clicked Andrew Ofthesong Excel Programming 2 December 1st 03 05:05 PM
XL2000: Shape object events GSQUARED Excel Programming 1 October 22nd 03 05:15 PM
Hyperlink within the TextFrame of Shape Object..? Robert Stober Excel Programming 0 October 12th 03 10:05 PM
how to select two separate ranges into range object Serge[_2_] Excel Programming 2 October 1st 03 03:10 PM


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

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

About Us

"It's about Microsoft Excel"