VBA for deleting data in row but not formulas
Solved/Closed
Debs269
Posts
21
Registration date
Monday 15 October 2012
Status
Member
Last seen
18 August 2016
-
15 Oct 2012 à 06:50
Debs269 Posts 21 Registration date Monday 15 October 2012 Status Member Last seen 18 August 2016 - 31 Oct 2012 à 07:24
Debs269 Posts 21 Registration date Monday 15 October 2012 Status Member Last seen 18 August 2016 - 31 Oct 2012 à 07:24
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
- Number to words in excel formula - Guide
7 responses
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
15 Oct 2012 à 09:20
15 Oct 2012 à 09:20
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