Consulting

Results 1 to 7 of 7

Thread: Paste and keep source formatting

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Mentor
    Joined
    Aug 2020
    Location
    Hampshire
    Posts
    403
    Location

    Paste and keep source formatting

    Trying to fathom out how to paste from clipboard (contains Excel data) into a textbox in word using VBA, whilst using the word option of "keeping the source formatting".

    Dim Clipboard As MSForms.DataObject
        Set Clipboard = New MSForms.DataObject
        Dim myDataObject As DataObject
        
        Set myDataObject = New DataObject
        myDataObject.GetFromClipboard
    
    
    Clipboard.GetFromClipboard
            
            TextBox3.PasteSpecial Paste:=xlPasteValuesAndNumberFormats
    Many thanks!
    Last edited by HTSCF Fareha; 12-11-2020 at 08:06 AM.

Posting Permissions

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