VBA macro to move to the cell 'underneath'

Last update on October 8, 2009 09:07 AM by aakai1056
Published by aakai1056

VBA macro to move to the cell 'underneath'




Issue




If you need need VBA macro to move to the cell 'underneath' the particular button that is being pressed, 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 located.

Solution


This is very easy to set, all you will have to do is to 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
Best answers for « VBA macro to move to the cell 'underneath' » in :
[VBA] Deleting a word in a range of cell Show[VBA] Deleting a word in a range of cell In the case you want to delete a word in a sentence, just create a small macro that removes the word. But it will become difficult when you have word like, for example, "Theword" or "THEWORD" or...
[VBA] Detecting changes in cell Show[VBA] Detecting changes in cell The Event Change feature of a sheet will detects the change in the active cell but it gives no information about the content. The example given below will help you to find out if the cell was changed,...
Adding a VBA CommandButton with its respective the code ShowAdding a VBA CommandButton with its respective the code Paste these two sub in a general module (Module1 for example). Sub CreateButton() Dim Obj As Object Dim Code As String Sheets("Sheet1").Select 'create button ...
Spreadsheets - Cell Selection ShowCell Selection Spreadsheets are powerful tools for working with data. However, to work with data, it is necessary to have tools to rapidly choose the required cells. Line Selection An entire line can be chosen by clicking directly on the line...