I want to define a range base on a header column, however, the column might not be in the same location (e.g. column A this time and column D next time).
I want to define the column range based on the header name regardless of location.
Any help would be greatly appreciated.
Here is my temporary work around to find and format the column, but this will not help me once I try to add the mathematical portion to my sheet.
I have two date columns that I format in this manner to make sure that they are accurately formatted.
currently the Range is defined as the entire column containing the active cell.
Code:
Cells.Find(What:="PIDLDT", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Range(ActiveCell, ActiveCell.EntireColumn).Select
Selection.TextToColumns Destination:=Range(ActiveCell, ActiveCell.EntireColumn), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 5), TrailingMinusNumbers:=True
Selection.NumberFormat = "mm/dd/yy;@"