0

I am wondering if it's possible to link a cell to a shape or picture that when I click the cell, no matter where the shape/picture is within the workbook, it should locate it. This is a shared document with other people who can edit it through excel online. I'd like a method which won't cause problems and work on the online version as well.

What I've tried:

I named a cell -> "Update". Then I right-clicked a shape -> hyperlink -> location within the workbook -> and selected "Update". So when I clicked the shape, it took me to the cell I named "Update". What I actually wanted was the opposite that by clicking the cell I locate the shape. The problem is for me, I tried to name that shape, but it doesn't show up in the hyperlink options like with cells.

Thanks!

1 Answer 1

0

To solve the issue you need a VBA (Macro):

Option Explicit

Sub SelectShape1()

 Sheets("Sheet1").Activate
 ActiveSheet.Shapes("Oval 1").Visible = True
 ActiveSheet.Shapes("Oval 1").Select

End Sub

Sub SelectShape2()

 Sheets("Sheet2").Activate
 ActiveSheet.Shapes("Smiley Face 1").Visible = True
 ActiveSheet.Shapes("Smiley Face 1").Select

End Sub



Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Selection.Count = 1 Then

      If Not Intersect(Target, Range("A1")) Is Nothing Then
        Call SelectShape1
      End If

      If Not Intersect(Target, Range("A2")) Is Nothing Then
       Call SelectShape2
      End If
      End If

 End Sub

Note:

  • Copy & Paste these Macro as Standard Module.
  • You may have many Shapes across Sheets, so that I've used Cell A1 & A2 to Click to Select them.

  • Insert Shapes in respective Sheets before you Click Cell A1 or A2 in Sheet 1.

  • With above shown Macros Range("A1"), Range("A2") & .Shape("Oval 1") & .Shape("Smiley Face 1") are editable.

  • Worksheet Change event records Click on Cell A1 & A2, then executes related Macro to select the Shape.

  • You may extend Code to locate others Shapes, since I'v created Macro for two only.

3
  • First of all, thank you for taking your time to answer my question sir! Does Macro functions work on Excel online? Because I have a workbook that is shared with people to edit. I tried a method like giving the cell a name and right clicking it -> hyperlink, from there I could see the cell I named and I was able to select it. This worked if linking a cell to a cell, but not a shape.
    – Sunny S-h
    Commented Feb 21, 2019 at 3:10
  • @SunnyS-h, You will not be able to create macro with VBA in Excel Online, however you can open and edit VBA-enabled spreadsheets without removing or corrupting the VBA contained in the file. For more information you may refer to the section ‘VBA and macro scripting’ in the link below: technet.microsoft.com/en-us/library/… Commented Feb 21, 2019 at 4:54
  • @SunnyS-h, since you are working with Excel Online therefore my suggestion is better edit the question and add line at the end that, you need solution should work with Excel Online. Commented Feb 21, 2019 at 4:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .