Results 1 to 3 of 3

'Copy & Paste Without Formatting' Macro problem

Threaded View

  1. #1
    Registered User
    Join Date
    12-12-2010
    Location
    Madrid
    MS-Off Ver
    Excel 2007
    Posts
    4

    'Copy & Paste Without Formatting' Macro problem

    Hi and thanks for all your help in advance.

    I created a macro with CTRL-V shortcut to copy text from websites and PDF's and paste them directly into Excel without formatting - just as text. Here is the VBA script and it works perfectly;


    Sub PasteWOFormatting()
    '
    ' PasteWOFormatting Macro
    ' Press Ctrl+v to paste text into a cell without any formatting
    '
    ' Keyboard Shortcut: Ctrl+v
    '
        ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:= _
            False
    End Sub
    HOWEVER, whenever I copy and then try to paste something within Excel, I get;
    'Runtime error 1004 - PasteSpecial Method of Worksheet class failed'

    I think its got something to do with the clipboard and I have searched all over the web to try and find a solution but nothing works. I am not much good with VBA and would love a simple solution such as an IF THEN function in my VBA script or something else that allows me to copy within Excel as well.

    Thank you so much for your time,
    Last edited by davesexcel; 12-12-2010 at 09:21 AM. Reason: code tags required

Thread Information

Users Browsing this Thread

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

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