Show Custom Error Message When No Data to Paste

  • Morning all.

    A pickle that I can not work out how to do, and I know it's gonna be one of those simple ones.

    Below is a macro I recorded to help copy 'Paste Special - values only' data between two spreadsheets that have different colour and conditional formatting in cells.

    However, if this is run and there is no data to paste, it throws up the End and Debug error.

    Any chance that someone knows that if there is no data sitting on the Clipboard, then a msg box would appear saying "Please select the data you require to be copied" in the message box.

    HELP! .. thanks heaps


    Tayler [the blue fox] :thanx:

  • Re: Stop Debug Message Change To Msgbox

  • Re: Show Custom Error Message When No Data to Paste

    thankyou so much .. works perfectly.

    I guess there is no chance of the clipboard not being cleared?

    For example.
    If the sheet it protected .. and I have something sitting on the clipboard, when I go to unprotect it manually or via the macro, it clears the clipboard and I have to go grab the data again.

    Any way around this to be built into this coding?

    Tayler [the blue fox] :thanx:

  • Re: Show Custom Error Message When No Data to Paste

    Sorry Dave,
    Sometimes I can't get my head around the coding, so sorry if I have appeared ignorant trying to understand it.

    I hadn't used that function before, but was able to remove it so as my sheet can be protected and unprotected.

    Thanks for you help .. it works great now :)

    Tayler [the blue fox] :thanx:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!