[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

select a range that may include blank cells

Posted on 2014-12-08
3
Medium Priority
?
116 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 35

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 53

Accepted Solution

by:
Rgonzo1971 earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

649 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