Consulting

Results 1 to 6 of 6

Thread: Script to paste only values in cell- Excel

  1. #1
    VBAX Regular
    Joined
    Jul 2009
    Posts
    58
    Location

    Script to paste only values in cell- Excel

    Hello All
    I need help in creating a script for SheetA that should allow to paste values in a cell (like right click -> paste special -> values). Other options like formats, formulas should not be allowed
    Regards
    Skopweb

  2. #2
    VBAX Tutor nst1107's Avatar
    Joined
    Nov 2008
    Location
    Monticello
    Posts
    245
    Location
    The method is .PasteSpecial. You can use Application.CutCopyMode = False to get rid of the dot highlight afterward if you need to.

  3. #3
    VBAX Regular
    Joined
    Jul 2009
    Posts
    58
    Location
    Can u help me with the script as i'm not literate at scripts
    Thanks in advance
    Skopweb

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    You don't need .PasteSpecial just to paste values.

    Use the likes of
    Range("A1")=Range("C22").value

    to copy from C22 to A1

    or

    Range("D12:F15")=Range("A3:C6").value

    to copy a range of cells at once.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  5. #5
    VBAX Regular
    Joined
    Jul 2009
    Posts
    58
    Location
    well
    the need here is that i want to allow only paste special values if from excel and paste special text from any other source
    is it possible to help me with the entire script?
    actually i have this sheet to distribute to a bunch of thick heads that only know to do ctrl+c and ctrl+v. they find complications on even doing a paste special
    please help !!!!!!!!!!!!!!!!

  6. #6
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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