View Full Version : [SOLVED:] Selecting named columns
Hi All,
Does anyone know how I could select a range of columns between one named column and a second named column?
Thanks, Aaron
Hi All,
Does anyone know how I could select a range of columns between one named column and a second named column?
Thanks, Aaron
Are the "named columns" named ranges? or do they have a name/title at the top (typically the first row of the relevant column)? something else?
The named columns are named ranges.
Bob Phillips
09-28-2005, 10:28 PM
Range(Range("range1")(1, 1).Offset(0, 1).Address, _
Range("range2")(1, 1).Offset(0, -1).Address).EntireColumn.Select
This is close, but I should clarify what I'm after. I don't want to select the entire columns - I start off with a range of entire rows selected, which I want to reduce to a range that comprises the area between the named columns and the previously selected rows...
Thanks, Aaron
Hi All,
Got it! Thanks for all your help. FYI, the final code was:
Sub ColSel()
Dim FirstRow As Integer
Dim NumPoints As Integer
NumPoints = Selection.Rows.Count
FirstRow = ActiveCell.Row
Range(Range("No.")(1, 1).Offset(FirstRow - 1, 0).Address, Range("Comment")(NumPoints, 1).Offset(FirstRow - 1, 0).Address).Select
End Sub
Thanks, Aaron
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.