+ Reply to Thread
Results 1 to 7 of 7

Creating an Error Message box if Macro does not have anything to copy

  1. #1
    Registered User
    Join Date
    07-02-2012
    Location
    Sarasota, FL
    MS-Off Ver
    Excel 2003, Mac2011
    Posts
    11

    Creating an Error Message box if Macro does not have anything to copy

    I am working on an expense spreadsheet that allows our employees to enter all their invoice data onto one page of the workbook, then by clicking a macro button all the data is copied into the datapage for analysis. Right now the macro to copy the data works but I would like to add an error message if ALL the values in the Q range = "N" (it only copies rows that have a "Y" in column Q).

    Here is the current code


    Please Login or Register  to view this content.
    Thank you for any help!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Creating an Error Message box if Macro does not have anything to copy

    k06,

    Welcome to the forum!
    Give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    07-02-2012
    Location
    Sarasota, FL
    MS-Off Ver
    Excel 2003, Mac2011
    Posts
    11

    Re: Creating an Error Message box if Macro does not have anything to copy

    Expense- 3test.xlsmThanks for your help Tigeravatar. I am getting a 1004 error on the autofilter. I have attached the file I am working on and the Macro you provided is under CopyTest

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Creating an Error Message box if Macro does not have anything to copy

    k06,

    Using your provided workbook the macro runs as expected and does not give me any errors...

  5. #5
    Registered User
    Join Date
    07-02-2012
    Location
    Sarasota, FL
    MS-Off Ver
    Excel 2003, Mac2011
    Posts
    11

    Re: Creating an Error Message box if Macro does not have anything to copy

    Hmm. It is still not working for me and is hiding rows 2-49. Any suggestions on what could be causing the difference on our machines? I'm running this on Excel Mac2011.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,335

    Re: Creating an Error Message box if Macro does not have anything to copy

    Use:
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Registered User
    Join Date
    07-02-2012
    Location
    Sarasota, FL
    MS-Off Ver
    Excel 2003, Mac2011
    Posts
    11

    Re: Creating an Error Message box if Macro does not have anything to copy

    That worked! Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1