Hello folks
I have a project workbook that takes the users input from sheet 1 and compares it against a range in sheet 2 ("Jan") If the match is found on this sheet ("Jan"), I need it to clear the row that the match is found on while preserving the formulas in "A" and "B2". So for example, if Jon is found in "A7", cells "A7" and "B7" are cleared but still hold the formula while cells "C" thru "G" are cleared as well. (cells C thru G are just normal cells). The highlighted text below keeps giving me a runtime error. One last level of complexity, if this can work, I need it to look through the other 11 worksheets "Feb" thru "Dec" and do the same. Thanks in advance!
Do
Ans = InputBox("Enter the name of the associate you wish to remove.")
If Ans = "" Then Exit Sub
If Application.CountIf(Range("A1:A358"), Ans) > 0 Then
Sheets("Jan").Select
Flg = True
For rw = 358 To 3 Step -1
If Cells(rw, "A") = Ans Then Rows(rw).Cells.SpecialCells(xlCellTypeConstants).ClearContents
Next rw
End If
If Not Flg Then If MsgBox("That entry is invalid. Do you want to try again?", vbYesNo) = vbNo Then Exit Sub
Loop Until Flg
I have a project workbook that takes the users input from sheet 1 and compares it against a range in sheet 2 ("Jan") If the match is found on this sheet ("Jan"), I need it to clear the row that the match is found on while preserving the formulas in "A" and "B2". So for example, if Jon is found in "A7", cells "A7" and "B7" are cleared but still hold the formula while cells "C" thru "G" are cleared as well. (cells C thru G are just normal cells). The highlighted text below keeps giving me a runtime error. One last level of complexity, if this can work, I need it to look through the other 11 worksheets "Feb" thru "Dec" and do the same. Thanks in advance!
Do
Ans = InputBox("Enter the name of the associate you wish to remove.")
If Ans = "" Then Exit Sub
If Application.CountIf(Range("A1:A358"), Ans) > 0 Then
Sheets("Jan").Select
Flg = True
For rw = 358 To 3 Step -1
If Cells(rw, "A") = Ans Then Rows(rw).Cells.SpecialCells(xlCellTypeConstants).ClearContents
Next rw
End If
If Not Flg Then If MsgBox("That entry is invalid. Do you want to try again?", vbYesNo) = vbNo Then Exit Sub
Loop Until Flg