Solved

Select column A through Q down to last used row

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Preserve formatting during mail merge using VBA 18 43
vba to flip column 14 21
V-Lookup 11 20
Excel 2010 Pivot Table Calculated Fields 2 15
A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

828 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