Solved

select a range that may include blank cells

Posted on 2014-12-08
3
105 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
[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
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 50

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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 in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

756 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