Sub AddData()
Dim TPE_Report As Worksheet
Dim TPE_Records As ListObject
Dim ColPtr As Long
Dim LastRow As Long
Dim NewRecord As Variant
Set TPE_Report = ActiveWorkbook.Worksheets("TPE Report")
Set TPE_Records = TPE_Report.ListObjects.Item("table2")
With TPE_Report
NewRecord = Array(.Range("New.FIPS").Value, .Range("New.State").Value, .Range("New.County").Value, .Range("DATA.TYPE").Value, .Range("DATA.SOURCE").Value, .Range("DateRange").Value)
End With 'new ecord
TPE_Records.ListRows.Add AlwaysInsert:=True
LastRow = TPE_Records.ListRows.Count
TPE_Records.ListRows(LastRow).Range.Value = NewRecord
End Sub
Named ranges for new record input cells:
DATA.SOURCE ='TPE Report'!$E$11
DATA.TYPE ='TPE Report'!$E$9
DateRange ='TPE Report'!$E$13
New.County ='TPE Report'!$C$13
New.FIPS ='TPE Report'!$C$9
New.State ='TPE Report'!$C$11
No reason for empty rows in the table...
Bookmarks