Solved

Select column A through Q down to last used row

Posted on 2013-06-03
2
329 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
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.

746 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

12 Experts available now in Live!

Get 1:1 Help Now