Move Cursor To One Cell Below Last Row With Data
Ever want to paste some data into new empty cell after the last cell with data in certain column? Then take a look at this simple macro.
'first, select cell in the first row of that column, like A1, K1, etc
Range("A1").Select
'move to the last cell with data
Selection.End(xlDown).Select
'move to one row below it
ActiveCell.Offset(1, 0).Select
'paste the copied data in there
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Simple isn’t it? Simple code, but will help us a lot each time we wanna move the active cell into one cell below the last cell contained any kind of data, in the same column.
One requirement needed to use this simple excel vba macro, first we need to select the first cell in the same column where we wanna do the selection.
Related Entries
External Resources
- Microsoft Excel 2003/2007 Video Tutorials
Step-by-step video guide to mastering Charts, PivotTable, Data Analysis and Macro programming in Microsoft Excel in 5 hours.
- 101 Secrets of Microsoft Excel
Discover 101 of Excels little-known secrets that have been hiding right under your nose.
Tagged with: ActiveCell, excel vba, last row with data, move cursor, Offset, vba macro
pvk
Hi,
I am a beginner using VBA. Can someone help me with the code that will bring my cursor back to cell A30 when I click a button that I’ve inserted at around cell P,30. I have inserted the button but can’t get it to work using some hints i found online. thanks
PK
Bob
PK try this.
=====================
Sub moveA30()
Range(“a30″).Activate
End Sub
=====================
I presume you know how to assign the macro to the button object?
Richard Pontefract
Hello,
I’m trying to run a macro that will cut and paste data from one cell to another in the same row and want to be able to utlize that same macro on any row I choose. What does the formula look like when I don’t want a specific column/row reference.
Thx
rgp
Poer
Halo Richard,
To cut and paste data from one cell to another cell in the same row, we can use something like this:
change 5 into the distance of destination column from the source column.