Solved

select a range that may include blank cells

Posted on 2014-12-08
3
102 Views
Last Modified: 2014-12-09
can an expert help me out here.

I need to select a range that includes blank cells.

i.e. The range I need to select is from A to P and could be A1 to P10 or A1 to P50  etc

within that range there are sometimes blank columns i.e. column F, column I, column K , Column L but sometimes these columns will have data.

Can you provide VBA that will select this sort of range please.
0
Comment
Question by:Jagwarman
3 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40486750
Do you mean:

range(cells(1,1),cells(50,16)).Select

Open in new window

?
0
 
LVL 33

Expert Comment

by:Norie
ID: 40486754
This will select everything from column A to P from row 1 down to the last row in column P.
Range("A1", Range("P" & Rows.Count).End(xlUp)).Select

Open in new window

0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40486798
Hi,

If the complete col is Col A

then pls try

Range(Range("A1"), Cells(Range("A" & Cells.Rows.Count).End(xlUp).Row, "P")).Select

Regards
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

777 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