Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Select Columns by the Name of Column in the Header Row

  Asked By: Muaz    Date: Dec 13    Category: MS Office    Views: 8122
  

In Excel VBA can you select a column depending on the Name of the
Column in the header row?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Rosie Brooks     Answered On: Dec 13

Could you maybe you should use a "Name" for the column  and select
that?

Otherwise here is some quick code - mostly from recording - to select
a column with a particular heading...

' Go to the "School" Column.
Rows("1:1").Select
Selection.Find(What:="School", _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False).Activate
ActiveCell.Select
Range(ActiveCell, ActiveCell.Offset(6536, 0)).Select

 
Didn't find what you were looking for? Find more on Select Columns by the Name of Column in the Header Row Or get search suggestion and latest updates.




Tagged: