maglerem
02-03-2011, 05:52 PM
Hello
I want to thank any and everyone in advance for helping me on this! I am using excel 2003 and am a bit of a novice when it comes to VBA coding.
I found a code that works almost perfectly for me there are only 2 problems –
1.I only want it to apply to ONLY the sheet I am in NOT all the sheets in the workbook
2.I want it to erase ALL rows that contain formulas that come back with a #N/A in the “G” column.
This code seems to miss a few of the #N/A s. Here is the code –
Sub test()
For Each Sheet In ActiveWorkbook.Sheets
For Each cell In Sheet.Columns("J:K").Cells
If IsError(cell.Value) = True Then
Sheet.Rows(cell.Row).Delete (xlUp)
End If
Next cell
Next Sheet
End Sub
Here is the link I found the code at - "sqldrill.com/excel/programming-vba-vb-c-etc/356944-delete-row-if-formula-brings-back-error.html"
Thank you thank you thank you!
Erica
I want to thank any and everyone in advance for helping me on this! I am using excel 2003 and am a bit of a novice when it comes to VBA coding.
I found a code that works almost perfectly for me there are only 2 problems –
1.I only want it to apply to ONLY the sheet I am in NOT all the sheets in the workbook
2.I want it to erase ALL rows that contain formulas that come back with a #N/A in the “G” column.
This code seems to miss a few of the #N/A s. Here is the code –
Sub test()
For Each Sheet In ActiveWorkbook.Sheets
For Each cell In Sheet.Columns("J:K").Cells
If IsError(cell.Value) = True Then
Sheet.Rows(cell.Row).Delete (xlUp)
End If
Next cell
Next Sheet
End Sub
Here is the link I found the code at - "sqldrill.com/excel/programming-vba-vb-c-etc/356944-delete-row-if-formula-brings-back-error.html"
Thank you thank you thank you!
Erica