For i = 1 To repNumber
TryAgain:
On Error GoTo ErrH:
repName = InputBox("Enter rep name you want to exclude.", "Name of Rep")
.PivotItems(repName).Visible = False
Next i
ErrH:
MsgBox "Try Again"
GoTo TryAgain:
It shows an error if I type in Rep name that doesn't exist in the PivotTable. So I'm trying to use an error handler to let a user type Rep name again. But after the second time I type something wrong, instead of going to the error handler, the code terminates itself.
I'm not sure if 'On Error GoTo' is in the wrong line.