View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Wigi Wigi is offline
external usenet poster
 
Posts: 396
Default How to return a column number?

Hi

You could use a COUNTA function on a row in the database that has no empty
cells (header row for instance).

That count gives you the number of columns used if you start from column 1.


--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"sycsummit" wrote:

I have a large database that continues to grow on a weekly basis. Within
this database, I have formula references using vlookup, but I keep having to
adjust the col_index_num for these cells because the database keeps
expanding. Is there a function I can use to specify the right-most column in
the database instead of using a fixed column for vlookup? Ie,
"farthest-right" instead of "M", so if the database extends through columns
AK or LAA or beyond it always returns the column label of that right-most
data column?