omair1051992
New Member
- Joined
- Mar 12, 2012
- Messages
- 16
I am trying to write a Macro that will identify a particular column by its field header (i.e. first row) and will run a specific set of code on that particular column.
My current code looks like this, coverting New York to NY:-
Cells.Replace What:="New York", Replacement:="NY", LookAt:=xlPart, SearchOrder:=xlByRows
This code applies to 'New York' found in the entire sheet. I need to identify a column that is named 'State' and then make the code run ONLY on that column.
My current code looks like this, coverting New York to NY:-
Cells.Replace What:="New York", Replacement:="NY", LookAt:=xlPart, SearchOrder:=xlByRows
This code applies to 'New York' found in the entire sheet. I need to identify a column that is named 'State' and then make the code run ONLY on that column.