Results 1 to 6 of 6

400 Error when trying to Paste into an Excel Table

Threaded View

  1. #1
    Registered User
    Join Date
    07-09-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    4

    400 Error when trying to Paste into an Excel Table

    I want to paste values into an Excel Table that is on a protected sheet.
    I've put this code together which works, but only when I specify in the code where to copy from. The problem is that I want to specify what to copy before I run the code
    If I just remove the line which copies the data I get a 400 error

    Sub Transfer()
    
    ActiveSheet.Unprotect ""
    
    
    Application.ScreenUpdating = False
    
    Sheets("TR").Range("A1:A4").Copy 'When I exclude this line I get a 400 error
    Sheet2.Range("B" & Rows.Count).End(3)(2).PasteSpecial xlValues
    
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
    
    ActiveSheet.Protect ""
    
    End Sub
    Last edited by FDibbins; 07-14-2020 at 03:44 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Paste excel table in clipboard to an active excel sheet VBA
    By ulvrah in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2019, 06:38 AM
  2. [SOLVED] I am getting error as "Run Time error '1004' Microsoft excel cannot paste the data
    By Amittapre in forum Excel Programming / VBA / Macros
    Replies: 43
    Last Post: 03-24-2017, 04:40 PM
  3. [SOLVED] Paste Values vba error (MS Excel 2007)
    By Pi* in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-11-2016, 04:31 PM
  4. Excel VBA copy paste 1004 error
    By salonee in forum Excel General
    Replies: 2
    Last Post: 12-19-2014, 10:53 AM
  5. [SOLVED] using VBA to copy paste table when cell value - VBA error
    By brdstyle in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-28-2013, 01:58 AM
  6. Paste Excel table as a table in Powerpoint
    By chuzasoft in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 01:33 AM
  7. Excel Macro Error - Run time error 1004 - Paste method of worksheet class failed
    By kvflynn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2012, 10:51 AM

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