Search : in
By :

Issue with Selection.End(xlDown)

Last answer on Jun 9, 2009 5:46:18 pm BST linda, on Jun 9, 2009 4:52:47 pm BST 
 Report this message to moderators

Hello,
I am working on a few macros and came across this problem. If I use the code below to select a range of cells and if my working rows only have one row, the command selects, in this example, C2 all the way down to the maximum ie. C9999999999. The code halts with an error when it is looping through an infinite (or very large) number of cells. I do not have problems when the data consists of more than one row. I only want to select everything in column C, starting in C2 that has data, not the blank cells below

Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
For Each Cell In Selection
command
command
command
Next Cell

Configuration: Windows XP Internet Explorer 7.0

Best answers for « Issue with Selection.End(xlDown) » in :
Spreadsheets - Cell Selection Show Cell Selection Spreadsheets are powerful tools for working with data. However, to work with data, it is necessary to have tools to rapidly choose the required cells. Line Selection An entire line can be chosen by clicking directly on the line...
Epson – parts inside your printer are at the end of their life ShowEpson – parts inside your printer are at the end of their life After a certain period of time and of consequent use of your printer, you may have come across the error message parts inside your printer are at the end of their life. In...
Select multiple items ShowSelect multiple items Intro How to proceed? Intro To select multiple items scattered in a folder,normally you can keep hold down the Ctrl key while selecting. Under Vista, a new method is to use the check boxes. How to proceed? Go...
Epson Error Message – “End of Service Life” ShowEpson Error Message – “End of Service Life” Download and install SCC Service Utility If your Epson printer has been displaying the error message “End of Service Life”, hold it before planning to buy a new one. The problem does...
Download SelectView Filter ShowInternet is certainly an unfailing source of information, but some sites and some Web pages include too many pubs. These pubs block the bandwidth and decelerate considerably your speed of connection. Select View Filter is a program allowing to filter...
HTML forms ShowForms Interactive forms let web page authors give their pages interactive elements, such as for receiving messages from their readers, much like the reply cards found in some magazines. The reader enters information by filling in fields or clicking...
Creating an RJ45 crossover cable ShowWhat's an RJ45 plug? A network card may have several types of connectors, with the most common being: An RJ45 connector; A BNC connector (coaxial cable). The RJ-45 is the one which interests us here, as it it the most widely used. The cables...
Operating Systems - MS-DOS - Tips ShowSetting the CD-ROM drive The CD-ROM drive is configured in the config.sys and autoexec.bat system files. The CD-ROM drive device driver must be configured in the config.sys file (even if the device is automatically detected in Windows). To do...

1

 rev_do, on Jun 9, 2009 5:46:18 pm BST

Hye there, i've searched something.. it can help you:

http://support.microsoft.com/kb/291308

Reply to rev_do