View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Radu Radu is offline
external usenet poster
 
Posts: 13
Default How do I refer (in VBA Code) to a column by caption instead of index ?

Thank you, Ross.... What I need is this:

In a module (VBA code) I need to be able to refer to columns in my
spreadsheet not by position, since the user might change the columns'
order, but by Caption (the caption is NOT negociable).

So in the first row I have the captions, like
Caption 1 Caption 2 Caption 3
and in the subsequent rows I have the data:
a b c
d e f

I need to be able to write in code NOT .Columns(2), NOT columns ("B"),
since the columns might move, but .Columns("Caption 2")...

Radu