VBA macro-move to cell underneath the button
Solved/Closed
Hello,
I want my VBA macro to move to the cell 'underneath' the particular button that is being pressed. (I have a series of buttons down the page, each will run the same macro / do the same thing, but starting from a different location each time - i.e. starting from where the button is). Any ideas?
Alison
I want my VBA macro to move to the cell 'underneath' the particular button that is being pressed. (I have a series of buttons down the page, each will run the same macro / do the same thing, but starting from a different location each time - i.e. starting from where the button is). Any ideas?
Alison
Related:
- Excel vba set active cell
- Vba case like - Guide
- Number to words in excel formula without vba - Guide
- Excel mod apk for pc - Download - Spreadsheets
- Maximum active checking torrents - Guide
- Excel vba hide formula bar - Guide
2 responses
put this code in a macro called by the button
Dim r As Range
Set r = ActiveSheet.Buttons(Application.Caller).TopLeftCell
Range(Cells(r.Row, r.Column), Cells(r.Row, r.Column)).Select
Dim r As Range
Set r = ActiveSheet.Buttons(Application.Caller).TopLeftCell
Range(Cells(r.Row, r.Column), Cells(r.Row, r.Column)).Select
Apr 5, 2010 at 02:18 AM
Aug 2, 2010 at 01:55 AM
"Unable to get the Buttons property of the Worksheet class"
Aug 2, 2010 at 01:57 AM
Aug 2, 2010 at 08:54 AM
Dim r As Range
Set r = ActiveSheet.Buttons(Application.Caller).TopLeftCell
Range(Cells(r.Row, r.Column), Cells(r.Row, r.Column)).Offset(0, -1).Select
Aug 2, 2010 at 11:02 PM
The same run-time error occurs
"Unable to get the Buttons property of the Worksheet class"
This is my Macro:
Sub Knockout()
'
' Knockout Macro
' Macro recorded 02/08/2010 by Admin
'
Dim r As Range
Set r = ActiveSheet.Buttons(Application.Caller).TopLeftCell
Range(Cells(r.Row, r.Column), Cells(r.Row, r.Column)).Offset(0, -1).Select
ActiveCell.Value = ActiveCell.Value + 1
'
End Sub
Is this wrong?