Solved

Select column A through Q down to last used row

Posted on 2013-06-03
2
352 Views
Last Modified: 2013-06-03
In VBA I need to be able to select from column A through column Q, then down to the last used row.  I tried using:
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select
But the problem is sometimes not all of the columns are populated, so it does not include all of the columns.  Column A and column Q always have data in them.

Thank you in advance for you assistance.
0
Comment
Question by:jmkbrown
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 39216920
Try

Range("A1:Q" & Range("A:Q").Find("*", Range("A1"), , , , xlPrevious).Row).Select
0
 

Author Closing Comment

by:jmkbrown
ID: 39216941
This works perfectly!  Thank you very much!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

809 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