This article was previously published under Q89949
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
In Microsoft Excel, you can select all the data on your worksheet bypressing the key combination CTRL+SHIFT+END (CONTROL+SHIFT+END onMacintosh). You can also simulate these keystrokes in the macro describedin this article.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Sample Visual Basic Procedure
The following procedure selects data from the currently selected cell, tothe end of the data on your worksheet.
Sub Select_All() Range(Selection, Selection.SpecialCells(xlLastCell)).Select End Sub
You can easily modify the procedure to select from a specific cell byadding the following statement to the beginning of the procedure:
where B2 is the reference of the specific cell.
Microsoft Excel version 4.0 Macro
The following macro selects data from the currently selected cell, to theend of the data on your worksheet. You can easily modify the macro toselect from a specific cell by changing the SELECT() function in cellA2 to select the starting cell you want.
For example, to select from the first cell (R1C1) on your worksheet,change the SELECT() function in A2 to read: =SELECT("R1C1").