drawing objects

compusheaf

Board Regular
Joined
Jun 17, 2004
Messages
195
I have 10 sheets. On each sheet I have a drwing object (Rectangle). I want to write a macro which will select all drawing objects in that workbook and gives hyperlink to Sheet 1.

If this is not possible then, can anyone provide me a code to renmae a drwing object
 

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
Hi compusheaf,

Give this macro a try:

Sub HyperlinkAllShapes()
Dim Sht As Object
Dim Shp As Shape
On Error Resume Next
For Each Sht In Sheets
For Each Shp In Sht.Shapes
Sht.Hyperlinks.Add anchor:=Shp, Address:="", SubAddress:="Sheet1!b4"
Next Shp
Next Sht
End Sub

This hyperlinks all hyperlinkable shapes to sheet1 cell b4.
 

Watch MrExcel Video

Forum statistics

Threads
1,119,127
Messages
5,576,244
Members
412,709
Latest member
Rishu
Top