Oct 27 2021 10:21 AM - edited Oct 27 2021 12:37 PM
When I click any cell, how do I use VBA and cell selected event to move my shape to the bottom center of selected cell? For that matter, would it be much different to any of the sides of the selected cell?
Oct 27 2021 11:56 AM
Hold down the left Alt key while moving or resizing the shape. It will then snap to the cell edges.
Oct 27 2021 12:35 PM - edited Oct 27 2021 12:37 PM
I was thinking more like when you helped me with VBA to do this. So it would be in the Cell Selected Event [Previous help you gave me]. I reworded OP.
Oct 27 2021 02:25 PM
SolutionAh, OK.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
With Me.Shapes(1)
.Top = Target.Top + Target.Height - .Height
.Left = Target.Left + (Target.Width - .Width) / 2
End With
End Sub
Oct 27 2021 03:16 PM
Oct 28 2021 02:39 AM
Oct 27 2021 02:25 PM
SolutionAh, OK.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
With Me.Shapes(1)
.Top = Target.Top + Target.Height - .Height
.Left = Target.Left + (Target.Width - .Width) / 2
End With
End Sub