VBA for deleting data in row but not formulas
Solved/Closed
Debs269
Posts
21
Registration date
Monday October 15, 2012
Status
Member
Last seen
August 18, 2016
-
Oct 15, 2012 at 06:50 AM
Debs269 Posts 21 Registration date Monday October 15, 2012 Status Member Last seen August 18, 2016 - Oct 31, 2012 at 07:24 AM
Debs269 Posts 21 Registration date Monday October 15, 2012 Status Member Last seen August 18, 2016 - Oct 31, 2012 at 07:24 AM
Related:
- How to clear cells but not formulas
- Based on the cell values in cells b77 ✓ - Excel Forum
- Little alchemy formulas - Guide
- Based on the values in cells b77 b88 ✓ - Excel Forum
- Name Values - Excel Forum
- Fill adjacent cell with number from text answer ✓ - Excel Forum
7 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Contributor
Last seen
December 27, 2022
555
Oct 15, 2012 at 09:20 AM
Oct 15, 2012 at 09:20 AM
Hi Debs,
Once you have implemented the code below, select a cell from the row you want to keep the formula's from and run the code.
Best regards,
Trowa
Once you have implemented the code below, select a cell from the row you want to keep the formula's from and run the code.
Sub KeepFormulas()
Dim sRow, lCol As Integer
sRow = ActiveCell.Row
lCol = Cells(sRow, Columns.Count).End(xlToLeft).Column
For Each cell In Range(Cells(sRow, 1), Cells(sRow, lCol))
If cell.HasFormula = False Then cell.ClearContents
Next cell
End Sub
Best regards,
Trowa