I want a shape or chart to be displayed on a certain position in my screen (window) but independent of a specified range.
The code below doesn't work if certain rows are hidden or filtered.
Sub Example()
CenterShape Me.Shapes("Rectangle 1")
End Sub
Public Sub CenterShape(o As Shape)
o.Left = ActiveWindow.VisibleRange(1).Left + (ActiveWindow.VisibleRange.Width / 2 - o.Width / 2)
o.Top = ActiveWindow.VisibleRange(1).Top + (ActiveWindow.VisibleRange.Height / 2 - o.Height / 2)
End Sub
Does a chart has a window handle for instance?
Kind regards,
Stranno