How can I make a macro that will insert a new row at the end of my data? I am able to do it manually, but I want to automate it and add it to a button (the button part I can do I just dont know how to select the last row of my data)
I f you have contiguous data (that is, without any breaks in the data) than all you need to do is go to Data, Form and click New. I believe you are limted 30 columns in your form. (not sure about that)
Sub_GoLastRow
Application.Goto Reference:="datatop"
LastCell = [A65536].End(xlUp).Offset(1, 0).Address
Range(LastCell).Select
End Sub
The first row references a cell named "datatop" - an arbitrary name - you can use whatever name you prefer. The reason for using a range name, is so that your routine will work regardless of which worksheet it is activated from. The name "datatop" is of course assigned to a cell somewhere at the top of your data, but it can be anywhere on the sheet containing your data. If you already have a name assigned (like "data" then used that name instead.
Method of Assigning a Range Name:
a) Highlight the cell or range-of-cells
b) Hold down the <Control> key and hit <F3>
c) Type the name
d) Hit <Enter>
I hope this helps. Please advise as to how you make out.
Thanks, that way seemed to almost work
Application.Goto Reference:="ID"
LastCell = [A65536].End(xlUp).Offset(1, 0).Address
Range(LastCell).Select
The problem is that I have my data, then some formulas..then a table below that, and the code you gave me seems to jump all the way down past everything..I want it to just go to the end of my data, or the end of my data+1.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.