Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Find Column to use based on Name of Header

You would first have to define the range of headers. Then search that range
for the header text using Find. That will give you a column number that you
can assign to a variable, say ColNum. Then your code has to be re-written
to something like:
Set Rng = Range(Cells(2,ColNum), Cells(2,ColNum).End(xlDown)).
Please post back if this doesn't work for you or if you need more. HTH
Otto
"DJS" wrote in message
...
Hello~

~~~~~~~~~~~~~~
Here is a snippet of my code:

Set rng = Range(Range("J2"), Range("J2").End(xlDown))
~~~~~~~~~~~~~~

Instead of referencing Column J (as above), I would like to find the
correct
Column based on the name of the column header (in this case it is "VIN").

Thanks.



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
Return column header based on last value in row C. Excel Worksheet Functions 3 April 12th 10 08:53 AM
Returning Column Header based on Row and Value Chad DiGregorio New Users to Excel 3 July 6th 09 07:09 PM
pick from table based on row and column header PBcorn Excel Worksheet Functions 2 June 29th 08 07:00 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
macro to hide column based on header Todd[_6_] Excel Programming 6 September 4th 03 04:34 AM


All times are GMT +1. The time now is 02:46 PM.

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"