+ Reply to Thread
Results 1 to 3 of 3

How to stop #Ref! errors with macro that cuts and pastes from list

Hybrid View

  1. #1
    Registered User
    Join Date
    04-30-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    How to stop #Ref! errors with macro that cuts and pastes from list

    Hi all,

    Have used Excel for work for years but am only recently starting to realise and learn what VBA can do. A nice suprise!

    I am currently working on a large list of items which basically consists of the item description, the business division it relates to (often more than one item per division), and the sales that relate to it.

    The list has an autofilter on and a total row.

    I have written a marco that allows me to to run a report for which ever divisions I want to select, that selects that division on the autofilter, and cuts and pastes various columns into a new sheets that I can send out.

    However, whilst it works very well, if there is a nil return - for example Division D does not have any items this month - rather than just cutting and pasting the zero value that is in the list, I get a "#Ref!", meaning I then have to go through all the divisional sheets hard typing a zero over the error.

    Any tips on how to stop this happening?

    Thank you in advance!

    Rich

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to stop #Ref! errors with macro that cuts and pastes from list

    Maybe test before applying the autofilter?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-30-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to stop #Ref! errors with macro that cuts and pastes from list

    But without the autofilter, it can't select data by a particular division and thus cause the problem!

+ 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