Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 87
Default Dealing with column headers

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Dealing with column headers

colNo = Application.Match("TOWN",Rows(1),0))

and use colNo.


--
__________________________________
HTH

Bob

"Pawan" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 87
Default Dealing with column headers

Thats perfect...

Thanks Bob.. :-)

"Bob Phillips" wrote:

colNo = Application.Match("TOWN",Rows(1),0))

and use colNo.


--
__________________________________
HTH

Bob

"Pawan" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Column Headers Odyssey 62 Excel Discussion (Misc queries) 1 May 11th 07 08:35 AM
make column values column headers dunskii Excel Discussion (Misc queries) 5 September 19th 06 12:00 PM
Excel - returning column headers in a seperate column ExcelConfused Excel Discussion (Misc queries) 1 March 28th 06 02:49 PM
Column and row headers [email protected] Excel Discussion (Misc queries) 1 December 2nd 05 07:43 PM
column headers mtn_leisure Excel Discussion (Misc queries) 4 August 18th 05 12:18 AM


All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"