Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting range with variable row length

Status
Not open for further replies.
Sep 29, 2009
13
US
I have a range of data from a1:g-. The number of rows in this range vary. I need to be able to select only columns c:f and only the rows that are part of the CurrentRange. Put another way, I need to select only certain contiguous columns from the CurrentRange. I'd appreciate anyone pointing out how to do this.

Randy Davis
Denver, CO
 
Have a look at the Intersect method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I was able to figure out the solution:

Code:
RowCount = Range("A3").CurrentRegion.Rows.Count
Range("C1:G" & RowCount).Select

Randy Davis
Denver, CO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top