Remove Dotted Lines upon Copy.

Posted on 2011-05-09
Last Modified: 2012-05-11
I need to validate some data in Excel.

I am using VBA in Excel to copy / paste a range of cells which need to be validated with the below code.

Open in new window

Copy / paste happens, however, the range which I select to copy, has the rectangular dotted line moving around it self.

Is it possible to avoid the dotted lines or stop the dotted lines from showing up?
Question by:nainil
    LVL 41

    Accepted Solution

    You can make the dotted lines going away with the command

    Application.CutCopyMode = False

    after you've done your paste.

    LVL 41

    Expert Comment

    Also, you have several paste options for the .PasteSpecial method

    go to your VBA editor and type:

    Range("AA1").PasteSpecial (hit a space after typing PasteSpecial) and the autosensing should popup the different options you have for the paste...


    LVL 85

    Assisted Solution

    by:Rory Archibald
    Since you appear to be pasting everything:
    Range("H:H").Copy destination:=Range("AA1")

    should solve your problem.

    Author Closing Comment

    Either solutions suggested work seamlessly fine.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Average across mutiple sheets 5 32
    python question 5 38
    Copy a row 12 19
    Excel VBA - Hiding all Columns in a Named Range 7 8
    This article will show, step by step, how to integrate R code into a R Sweave document
    A short article about problems I had with the new location API and permissions in Marshmallow
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now