Ok - I have 2 parts that I need for Adding / Deleting Rows to a formula based worksheet. (If you can find a simplier option, I would appreciate)
Part 1 - VBA CODE - Based on a value in a cell ("ADD")(Column R) - copy the row above and insert copied cells (shift cells down) - Need to loop until "NO ADD") (need help with formula for the cell to get "ADD" - I have ****=IF(AND(ISTEXT(A9),ISNUMBER(A8)),"ADD","NO ADD") **** However when new row is copied down I get ****=IF(AND(ISTEXT(A10),ISNUMBER(A8)),"ADD","NO ADD") **** Again the copying needs to loop but ISNumber(stays the same) needs to be one less than ISTEXT()
Part 2 - This is the code I have to delete the rows and it works
Sub DELETEROWS()
Dim Firstrow As Long
Dim Lastrow As Long
Dim Lrow As Long
Dim CalcMode As Long
Dim ViewMode As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveSheet
Firstrow = 5
Lastrow = 500
For Lrow = Lastrow To Firstrow Step -1
With .Cells(Lrow, "Q")
If Not IsError(.Value) Then
If .Value = "DELETE" Then .EntireRow.Delete
'This will delete each row with the Value "delete"
'in Column Q, case sensitive.
End If
End With
Next Lrow
End With
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
Bookmarks