You can put anything you want on the first row, but in tables of data (I use
the term tables loosely here), it is usually desireable to have column
headers that describe what data is in each column. Excel has features that
use column headers if they exist. For example, sorting and filtering.
C is still an important language.. I started out on BASIC, then Clipper and
Pascal in the 80s. Learned VB in the 90s as an obvious leap from my most
comfortable BASIC background, and besides, I had a need to do Office
programming. Played a little with C but never took my programming seriously
I think I misunderstood your need. I thought you wanted the name to stay
with the data, allowing you to insert columns and have the name still refer
to the same data. This method does that.
If you want the name to stick to the column/range reference without regard
to inserted columns (always
Hi Howard,
No worries :) Ask as many questions as needed. Best to send your replies
to the list though, so you get the benefit of other replies (if only because
I may not have time to reply myself). This also allows other VBA learners
can benefit from the conversation.
A defined name
the simplest is
sub nameit
cells(7,4).name=whateveryouwanttonameit
end sub
=whaeveryounamedit
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguille...@gmail.com
-Original Message-
From: tangledweb
Sent: Sunday, March 18, 2012 5:22 AM
To: MS EXCEL AND VBA MACROS
Subject:
You can name the entire column as well;
range(C:C).name=mycolumn ' create workbook-level name
then reference it as:
range(mycolumn)
also works as/in a cell formula:
{ =mycolumn }
=match(findthis,mycolumn,0)
evaluate(mycolumn) ' formula eval from vba
[mycolumn] ' formula eval from vba