colNo = Application.Match("TOWN",Rows(1),0))
and use colNo.
--
__________________________________
HTH
Bob
"Pawan" <(E-Mail Removed)> wrote in message
news:CB79315B-1E8E-4CB1-96D6-(E-Mail Removed)...
> Hi...
>
> I am learning about writing macros. I always stuck up at one point.
> I need to do various activies on columns based on their headings. e.g. I
> have to replace all "NA" in the column whose heading is "TOWN". Currently
> I
> write the macro using column number. But if the columns gets shifted, then
> this macro will not work. How can I extract column number by identifying
> its
> heading?
>
> Regards,
> Pawan
|