I have a spreadsheet with 20 charts, each comparing one of our products vs similar products from our competitors, as well as a map for each competitor.
The charts run along the right side of the spreadsheet with the map on the left side. A drop down menu allows you to toggle between maps. The way the rest of the spreadsheet is laid out, there isn't room freeze the maps at the top, so I've written a macro (below) to allow the map to follow you as scroll down to the different maps. Problem is, where ever you click on the spreadsheet is where the map appears. Is there a way to keep it in line with column A?
Thanks in advance for your help.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myShape As Shape
Set myShape = Me.Shapes("Competitor A")
With Me.Cells(ActiveWindow.ScrollRow, ActiveWindow.ScrollColumn)
myShape.Top = .Top
myShape.Left = .Left
End With
End Sub
The charts run along the right side of the spreadsheet with the map on the left side. A drop down menu allows you to toggle between maps. The way the rest of the spreadsheet is laid out, there isn't room freeze the maps at the top, so I've written a macro (below) to allow the map to follow you as scroll down to the different maps. Problem is, where ever you click on the spreadsheet is where the map appears. Is there a way to keep it in line with column A?
Thanks in advance for your help.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myShape As Shape
Set myShape = Me.Shapes("Competitor A")
With Me.Cells(ActiveWindow.ScrollRow, ActiveWindow.ScrollColumn)
myShape.Top = .Top
myShape.Left = .Left
End With
End Sub
Last edited: