Hello!!
I need a Floating Command Button on the Excel Worksheet which can automatically moves around within the area of Active Window (if the Command Button is positioned on the Top Right Corner and as soon as I move the Cursor to the active cell in the Top Right corner then the Command Button should move to its Left and the Command Button would not leave the Active Window Area.)
I'm using below Codes to get the position of the Command Button in the Top Right Corner but issue with this code is it blocks view of the Cell on the Top Right Corner.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
With Me.CommandButton1
.Top = ActiveWindow.VisibleRange.Top 'ActiveCell.Top + ActiveWindow.VisibleRange '+ .Width
.Left = ActiveWindow.VisibleRange.Width - 93
End With
End Sub
I want it to be moved automatically to its left when the cursor position is on the top Right Cell, just beneath the Command Button.
Requesting help
Thanks in advance.
I need a Floating Command Button on the Excel Worksheet which can automatically moves around within the area of Active Window (if the Command Button is positioned on the Top Right Corner and as soon as I move the Cursor to the active cell in the Top Right corner then the Command Button should move to its Left and the Command Button would not leave the Active Window Area.)
I'm using below Codes to get the position of the Command Button in the Top Right Corner but issue with this code is it blocks view of the Cell on the Top Right Corner.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
With Me.CommandButton1
.Top = ActiveWindow.VisibleRange.Top 'ActiveCell.Top + ActiveWindow.VisibleRange '+ .Width
.Left = ActiveWindow.VisibleRange.Width - 93
End With
End Sub
I want it to be moved automatically to its left when the cursor position is on the top Right Cell, just beneath the Command Button.
Requesting help
Thanks in advance.