Tables

itsgrady

Board Regular
Joined
Sep 11, 2022
Messages
115
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
I use tables all of the time in Excel—makes life easier.

I have some tables in Excel with thousands of rows of information and it is hard to remind all endusers to use the shortcuts to navigate to the bottom of the table to add data on a new row. Is there a way to add data and a new row at the top of a table?

For each day of the year I have to enter the sales for each department for each day. It would be nice to enter this on the top row of the table.

Thanks for the help.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Here you go. Add a button/shape and assign the macro

VBA Code:
Public Sub InsertProjectListRecord()
' insert a record

    Dim nws As Worksheet
    Dim nRow As ListRow

    Set nws = ActiveSheet ' your sheet
    
    Application.ScreenUpdating = False
    Application.EnableEvents False
    
    Set nRow = nws.ListObjects("TBLNAME").ListRows.Add(1, AlwaysInsert:=True)
    ' select the new row
    nRow.Range(, 4).Select
    
    Application.ScreenUpdating = True
    Application.EnableEvents True
    
    Set nRow = Nothing
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,305
Members
449,095
Latest member
Chestertim

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