View Single Post
  #9   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Sat, 27 Nov 2004 18:26:54 -0700, "ShipHead" wrote:

A question here ... Why did you choose a1:a100 is this just a hypothetical
location?


That is just a hypothetical location. You should change it to the range in
which these numbers will be entered.

I guess I was thinking that I could integrate my own 'function'
in VB into excel... Something like Date, which keeps the underlying value
but modifies the display properties.


In Excel, functions cannot modify cell properties (including format). As far
as I know, the DATE worksheet function in Excel does not "modify" the display
properties (if by that you mean the cell format).

But perhaps I am misunderstanding you. Could you give an example as to exactly
what you mean?


If I understand your example then when excel is ready to redisplay the
worksheet
your Worksheet_Change function gets called. But I assume it only gets
called
for the ragne you specify. (I know VB well I'm just not used to using it in
excel,
if you know what I mean.)


The worksheet change event is generated whenever the worksheet changes. Look
at VBA HELP for Change Event. This macro I wrote runs whenever the change
event occurs, but it only checks the range defined.

You can certainly rewrite it to check other cells, to evaluate the contents in
some way and apply formatting based on additional rules, etc.

For speed purposes, you want to check as few cells as possible. If you set aoi
= [A;A] for example, you will see what I mean about speed.


--ron