I am a VERY beginner on macro's and can read minimal coding of a macro.
I found a macro on the internet that is supposed to clear the contents of all rows that contain specific data in a specific column. Of course, I had to modify the coding to match what my data. My data starts on row 8. I want it look at column H and if the word "null" exists, I want it to erase all the data in that row (either clear contents or deleting rows - I am not particular on this one). When I run the macro, it erase all data, starting from row 8 even if "null" does not exist.
Sub Clear_Contents()
For i = 8 To 1500
If Range("h" & i) <> "null" Then
Range("A" & i & ":M" & i).ClearContents
End If
Next i
End Sub
Also, my spreadsheet has multiple tabs (taken from another macro: "NY Reg", "NY Lic & REg", """Skip"" in Ramco", "Annual", "90 Day", "Support", "NY Term", "PA Stmt #", _
"PA Print Card Corp", "PA Print Card State", "PA Emp Ver", "PA Child Abuse", "NJN", "NJS", "Shannon"
Would I be able to add to the top of the macro the following so it would run on each tab at all at once or would I have to list each tab individually in the macro:
Sheets(Array("NY Reg", "NY Lic & REg", """Skip"" in Ramco", "Annual", "90 Day", "Support", "NY Term", "PA Stmt #", _
"PA Print Card Corp", "PA Print Card State", "PA Emp Ver", "PA Child Abuse", "NJN", "NJS", "Shannon")).Select
Sheets("NY Reg").Activate
I found a macro on the internet that is supposed to clear the contents of all rows that contain specific data in a specific column. Of course, I had to modify the coding to match what my data. My data starts on row 8. I want it look at column H and if the word "null" exists, I want it to erase all the data in that row (either clear contents or deleting rows - I am not particular on this one). When I run the macro, it erase all data, starting from row 8 even if "null" does not exist.
Sub Clear_Contents()
For i = 8 To 1500
If Range("h" & i) <> "null" Then
Range("A" & i & ":M" & i).ClearContents
End If
Next i
End Sub
Also, my spreadsheet has multiple tabs (taken from another macro: "NY Reg", "NY Lic & REg", """Skip"" in Ramco", "Annual", "90 Day", "Support", "NY Term", "PA Stmt #", _
"PA Print Card Corp", "PA Print Card State", "PA Emp Ver", "PA Child Abuse", "NJN", "NJS", "Shannon"
Would I be able to add to the top of the macro the following so it would run on each tab at all at once or would I have to list each tab individually in the macro:
Sheets(Array("NY Reg", "NY Lic & REg", """Skip"" in Ramco", "Annual", "90 Day", "Support", "NY Term", "PA Stmt #", _
"PA Print Card Corp", "PA Print Card State", "PA Emp Ver", "PA Child Abuse", "NJN", "NJS", "Shannon")).Select
Sheets("NY Reg").Activate