+ Reply to Thread
Results 1 to 4 of 4

400 Error When Deleting Rows

  1. #1
    Registered User
    Join Date
    10-02-2014
    Location
    Indiana, USA
    MS-Off Ver
    2013
    Posts
    12

    400 Error When Deleting Rows

    Hello,

    Scenario background: I have an excel document with several tables and charts. Instead of having users navigate through tabs to see them I am attempting to make a Dashboard sheet that will pull the selected table and chart. I am not having VBA generate the tables and charts, merely copy them from one sheet to the Dashboard sheet. This is working. I recently added an IF statement to see if there is already data on the sheet and if there is, to delete it. When there is no Data on the sheet the macro will run fine, however when there is data on the sheet I receive a 400 Error. I have been Googling solutions and so far all I have seen are solutions based on unprotecting the sheet (none of my sheets are protected) or hidden values (nothing is hidden). Below is my code.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: 400 Error When Deleting Rows

    Let's get Excel to help identify the problem. Near the top of the macro put this:
    Please Login or Register  to view this content.
    ... and at the end of the code put

    Please Login or Register  to view this content.
    Now when the macro errors it will popup the detailed error, let's see what that says.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-02-2014
    Location
    Indiana, USA
    MS-Off Ver
    2013
    Posts
    12

    Re: 400 Error When Deleting Rows

    JB,

    Thank you for the quick response.

    The Error handling spit out "Copy method of Range class failed"

  4. #4
    Registered User
    Join Date
    10-02-2014
    Location
    Indiana, USA
    MS-Off Ver
    2013
    Posts
    12

    Re: 400 Error When Deleting Rows

    JB,

    I think I figured it out. It was messing up with the variables in the Copy function. If I change those variables to the Range string that those variables call it works fine.

    Thank you very much for the error handling advice. I will definitely be adding that to every worksheet from now on.

    Below code works:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula error after deleting rows
    By dougmcc1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-12-2013, 11:32 AM
  2. [SOLVED] Automatically Deleting rows that contain error message REF#
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-01-2013, 01:46 PM
  3. Need Help-Error When Deleting or Inserting Rows
    By krisels in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-11-2012, 04:52 PM
  4. Error when deleting rows
    By wmureports in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2006, 03:25 PM
  5. [SOLVED] Code deleting all rows in error
    By JOUIOUI in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2006, 03:45 PM

Tags for this Thread

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