Automatically move button while scrolling

emmieh

New Member
Joined
Jun 25, 2009
Messages
11
Is it possible to let a button automatically move while scrolling? So you can click the button to move to the top of a sheet.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
This'll keep the button top left. In the sheet's code-module:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Shapes("CommandButton1").Top = Rows(ActiveWindow.ScrollRow).Top + 2
Shapes("CommandButton1").Left = Columns(ActiveWindow.ScrollColumn).Left + 2
End Sub
This code behind the (activeX) button will move the selection to the top of the sheet in the same column. In the sheet's code-module:
Code:
Private Sub CommandButton1_Click()
Cells(1, ActiveCell.Column).Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top