?
Solved

Select column A through Q down to last used row

Posted on 2013-06-03
2
Medium Priority
?
374 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

752 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