Keep formula last record, for 2nd xlup clear formula in excel

Iarianna81

New Member
Joined
Nov 22, 2017
Messages
6
Hi guys... Im newbie in here... I need help regarding below issue...
I have set formula in specific cell excel... Update data using userform... But i need remove value formula for 2nd last row xlup for avoid slow data.... Only keep last row formula for next record...any advice.......thanks for help
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Iarianna81,

Enter this portion of the code at the bottom of your code. It finds the last row and then copies and pastes values to the row above it.

Code:
    lastRow = Range("A" & Rows.Count).End(xlUp).Row
    
    Range("A" & lastRow - 1).Copy
    Range("A" & lastRow - 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

Let me know if you have any issues.

Bill
 
Upvote 0
i already try...but cant run
Sub ClearFormula()
Dim lRow As Long 'tambah
lastrow = Range("A" & Rows.Count).End(xlUp).Row

Range("A" & lastrow - 1).Copy
Range("A" & lastrow - 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,624
Messages
6,120,591
Members
448,973
Latest member
ksonnia

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