Hello my friends! I have an userform that records the same content at two Worksheets (Worksheet1 and Worksheet 2).
Whenever I need to erase an entire row content, I select a cell, click at trash can icon and it runs this code above:
But now I'm looking for help to erase the same content from both Worksheets.
Always when I run my userform, content is registered at both Worksheets, but at Worksheet 1 it's recorded 8 rows above comparing Worksheet2, for example:
Worksheet 1 = Content registered at row 10
Worksheet 2 = Same content registered at row 2
So, I need to run "Selection.EntireRow.ClearContents" at Worksheet 1 and "Selection.EntireRow.ClearContents" less 8 rows at Worksheet 2 to clean both of content at same time and I don't know how to do it.
Could you help me?
Since now I appreciate your time spent to help me. Have a nice New Year!
Whenever I need to erase an entire row content, I select a cell, click at trash can icon and it runs this code above:
Code:
Sub EraseActivity_Click()
Worksheets("Worksheet1").Unprotect 123
MsgBox "Content erased"
Selection.EntireRow.ClearContents
Worksheets("Worksheet1").Protect 123
End Sub
But now I'm looking for help to erase the same content from both Worksheets.
Always when I run my userform, content is registered at both Worksheets, but at Worksheet 1 it's recorded 8 rows above comparing Worksheet2, for example:
Worksheet 1 = Content registered at row 10
Worksheet 2 = Same content registered at row 2
So, I need to run "Selection.EntireRow.ClearContents" at Worksheet 1 and "Selection.EntireRow.ClearContents" less 8 rows at Worksheet 2 to clean both of content at same time and I don't know how to do it.
Could you help me?
Since now I appreciate your time spent to help me. Have a nice New Year!