Tables not updating my formula - may be a VBA issue

tbrynard01

Board Regular
Joined
Sep 20, 2017
Messages
129
Office Version
  1. 365
Platform
  1. Windows
I have a table where I insert a line and then copy and paste the previous line as a value as the data is being fed to the table from another worksheet.

I use this code but can't figure out my error as I've updated the formulas in the table yet when I insert a line it's not keeping the updates, it reverts back to the old formulas?

This is the code that I'm using:

Dim n As Long
With ActiveSheet.ListObjects("Table927")
.ListRows.Add AlwaysInsert:=True
n = .DataBodyRange.Rows.Count
.ListRows(n - 1).Range.Copy
.ListRows(n - 1).Range.PasteSpecial xlValues
End With
Application.CutCopyMode = False
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Can you please step through the code, while watching the sheet, and see if the code is doing what you think it is doing?
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,525
Members
448,969
Latest member
mirek8991

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