Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA Challenge: Creating a callout with exact location


Hey all,

I have a table (duh, excel!). I have created a small script: If you
right click any cell of that table, an entry "Insert Comment" in the
context menu appears. I want the action of that entry to create a
callout (in AutoShapes/callouts) whose tip points to that selected
cell. Does any guru know how to proceed about doing that in VBA?


--
naddad
------------------------------------------------------------------------
naddad's Profile: http://www.excelforum.com/member.php...o&userid=29817
View this thread: http://www.excelforum.com/showthread...hreadid=504682

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel VBA Challenge: Creating a callout with exact location

One way

Sub AddCallout()
Dim x, y
Dim shp As Shape
With ActiveCell
x = .Left
y = .Top
Set shp = ActiveSheet.Shapes.AddShape( _
msoShapeRoundedRectangularCallout, _
Left:=x, Top:=y - 120, Width:=100, Height:=100)
End With
End Sub

You will need to play with the numbers to get the shape that you want. The
connection between the bubble and the cell seems to tale 20% of its height,
extra to its height.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"naddad" wrote in
message ...

Hey all,

I have a table (duh, excel!). I have created a small script: If you
right click any cell of that table, an entry "Insert Comment" in the
context menu appears. I want the action of that entry to create a
callout (in AutoShapes/callouts) whose tip points to that selected
cell. Does any guru know how to proceed about doing that in VBA?


--
naddad
------------------------------------------------------------------------
naddad's Profile:

http://www.excelforum.com/member.php...o&userid=29817
View this thread: http://www.excelforum.com/showthread...hreadid=504682



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Excel VBA Challenge: Creating a callout with exact location

This should give you a start...

Public Sub AddCallout()
Dim shp As Shape

Set shp = ActiveSheet.Shapes.AddShape(msoShapeRoundedRectang ularCallout, _
ActiveCell.Left + ActiveCell.Width, ActiveCell.Top - 35, 75, 35)
shp.DrawingObject.Text = "Tada!"
End Sub
--
HTH...

Jim Thomlinson


"naddad" wrote:


Hey all,

I have a table (duh, excel!). I have created a small script: If you
right click any cell of that table, an entry "Insert Comment" in the
context menu appears. I want the action of that entry to create a
callout (in AutoShapes/callouts) whose tip points to that selected
cell. Does any guru know how to proceed about doing that in VBA?


--
naddad
------------------------------------------------------------------------
naddad's Profile: http://www.excelforum.com/member.php...o&userid=29817
View this thread: http://www.excelforum.com/showthread...hreadid=504682


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA Challenge: Creating a callout with exact location


Thanks, got it :)


--
naddad
------------------------------------------------------------------------
naddad's Profile: http://www.excelforum.com/member.php...o&userid=29817
View this thread: http://www.excelforum.com/showthread...hreadid=504682

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
Creating a Callout Box in Excel 2007 Vic Excel Discussion (Misc queries) 0 November 18th 09 11:57 PM
Creating an exact time display Pref Excel Worksheet Functions 3 May 28th 06 02:08 PM
How to return a specific data point from a large array if I don't know the exact location? [email protected] Excel Discussion (Misc queries) 4 May 2nd 06 03:54 PM
Creating Time location diagram in Excel Sooraj Excel Discussion (Misc queries) 0 January 11th 05 10:18 AM
opening a workbook without knowing its exact location Johan[_6_] Excel Programming 3 December 31st 04 09:33 AM


All times are GMT +1. The time now is 02:00 PM.

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"