Re: Function Won't Calculate -- Sometimes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Bill Martin -- (Remove NOSPAM from address)" <wylie@xxxxxxxxxxxxxxxxxxx>
wrote in message news:OICMMnDQFHA.604@xxxxxxxxxxxxxxxxxxxxxxx
> Fredrik Wahlgren wrote:
>
> >
> > Use Application.Volatile (True) like below:
> >
> > Function FirstNumberOffset(TopCell)
> > Application.Volatile (True)
> > RowOffset = 0
> > While Not (IsNumeric(TopCell.Offset(RowOffset, 0)))
> > RowOffset = RowOffset + 1
> > Wend
> > FirstNumberOffset = RowOffset
> > End Function
> >
> > /Fredrik
>
> ----------
>
> You're right - that seems to fix it. It's much more elegant than the
> solution that I stumbled upon which was to include a call parameter that
> contains an entire range of cells so if any of them change, then Excel
> knows to recalculate the function.
>
> Thanks...
>
> Bill
>

I thought of that but I figured that it could cause a circular reference.
I'm glad I could help.

/Fredrik


.



Relevant Pages