• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Error message if no data for pivot exists

Tharabai

Member
Hello..

Am filtering data based on the criteria and copy paste to new sheet. From the new sheet I have to put pivot.

Am using coding for the above. It works fine if there is data in new sheet. If no data exists in the new sheet, it throws an error message. Can this be customized error message like "No data to put pivot" or something like that.

Any help on this will be highly appreciated.
 
Something like below.

Code:
'Put this portion before the step in code that gives error
On Error Goto ErrHandler:

'Put this portion at end before End Sub
ErrHandler:
MsgBox "No data to put in Pivot"
 
Back
Top