FunsizedNerd
New Member
- Joined
- Mar 20, 2019
- Messages
- 17
I have opened a new workbook with data. I have created a command button and copied over some code to allow it to float
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error GoTo 0
With Cells(Windows(1).ScrollRow, Windows(1).ScrollColumn)
CommandButton1.Top = .Top + 100
CommandButton1.Left = .Left + 300
End With
End Sub
However, when I try to run this macro (both green play button and F5 shortcut) it doesn't run and comes up with the Macros pop-up form (to select a macro to run)
If I create a different macro, the new one comes up, but this one doesn't
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error GoTo 0
With Cells(Windows(1).ScrollRow, Windows(1).ScrollColumn)
CommandButton1.Top = .Top + 100
CommandButton1.Left = .Left + 300
End With
End Sub
However, when I try to run this macro (both green play button and F5 shortcut) it doesn't run and comes up with the Macros pop-up form (to select a macro to run)
If I create a different macro, the new one comes up, but this one doesn't