Insert row with formats and formulas
Closed
Debs269
Posts
21
Registration date
Monday October 15, 2012
Status
Member
Last seen
August 18, 2016
-
Feb 1, 2013 at 11:32 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Feb 5, 2013 at 12:00 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Feb 5, 2013 at 12:00 PM
Related:
- Excel auto insert row when data changes
- Grand theft auto v free download no verification for pc - Download - Action and adventure
- Stop facebook auto refresh - Guide
- Grand theft auto iv download apk for pc - Download - Action and adventure
- Auto download mms when roaming - Guide
- Insert gif in excel - Guide
2 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 2, 2013 at 03:05 PM
Feb 2, 2013 at 03:05 PM
ClearContents will clear formulas and text both leaving format alone
Since you dont want to clear some text, you have to clear it cell by cell
Since you dont want to clear some text, you have to clear it cell by cell
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Feb 5, 2013 at 12:00 PM
Feb 5, 2013 at 12:00 PM
Hi Debs,
Make a save first, if you are unhappy with result you can reload your file.
I assumed that if a row contains data, column A is always filled.
Here is the code:
Best regards,
Trowa
Make a save first, if you are unhappy with result you can reload your file.
I assumed that if a row contains data, column A is always filled.
Here is the code:
Sub InsertAndClearRow() Dim RowNumber As Integer RowNumber = Range("A" & Rows.Count).End(xlUp).Row + 1 Range("A5:AI5").Copy Range("A" & RowNumber).insert Shift:=xlDown For Each cell In Range("A" & RowNumber & ":AI" & RowNumber) If Left(cell.Formula, 1) <> "=" Then cell.Value = vbNullString Next cell Application.CutCopyMode = False End Sub
Best regards,
Trowa