It's not possible in the way you are thinking (ie it always stays in the
same relative position in the window), but you can make it stay in the same
position relative to the active cell. This is a button from the Control
toolbox, not Forms.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Row > 65530 Or ActiveCell.Column > 252 Then
CommandButton1.Top = ActiveCell.Offset(-3, 0).Top
CommandButton1.Left = ActiveCell.Offset(0, -3).Left
Else
CommandButton1.Top = ActiveCell.Offset(1, 0).Top
CommandButton1.Left = ActiveCell.Offset(0, 1).Left
End If
End Sub
This normally positions the top left corner of the button with the bottom
left corner of the active cell. If the active cell is row 65530 or greater,
or column IR or beyond, the button repositions to 3 cells up and 3 cells
left of the active cell to avoid the button resizing when it reaches the
edge/bottom of the sheet, and to avoid an error in the code when in the last
row or column.
The drawback with this is that when the active cell is either the bottom
visible row or the rightmost visible column, the button will be outside the
visible area.