Select the next 1000 rows down and copy to clipboard

Posted on 2014-08-11
Last Modified: 2014-08-12
In vba, how do I copy down the next 1000 cells down from the active cell, into the clipboard?  When I use the recorder it uses absolute values and I need relative values.  Is there a setting in vba to tell it to use relative values instead of absolute? or is this something I just need to remember?
Question by:RWayneH
    LVL 27

    Accepted Solution

    You can record with relative references instead of absolute:
    record relative references...but it might not really work in this case.  This setting is better for replicating formulas/functions.

    The better VBA code for this instance would be this:
    Sub Copy_1000()
        Range(ActiveCell, ActiveCell.Offset(999, 0)).Copy
    End Sub

    Open in new window

    Note that I'm offsetting 999 rows because I'm including the current row.


    Author Closing Comment

    Thanks for the help.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
    How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
    This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
    This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

    754 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

    25 Experts available now in Live!

    Get 1:1 Help Now