View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
pignick pignick is offline
external usenet poster
 
Posts: 14
Default Go to cell with maximum value when worksheet opened

Hi Gord,

Dates are in column A in the range A7:A400 (rows above contain some headers,
etc.). I haven't tried it yet as been very busy on other things today, but
wondered if perhaps copying that whole range and then doing a paste values
would then allow your original suggestion to work and find the maximum value
(i.e. last date). Does that make sense or do you have any other suggestions.
Is there an equivalent of COUNTIF in VBA?

Thanks in anticipation of further help to crack this one.

--
pignick


"Gord Dibben" wrote:

In which column will your dates be entered?

Will that column contain dates only or?


Gord

On Sun, 13 Jul 2008 11:24:00 -0700, pignick
wrote:

Thanks to both Mike & Gord for your suggestions, but that has only got me
part way there. I can now see how to write code that is implemented when a
particular worksheet is opened (Gord's answer), but unfortunately the result
using either of your code lines is taking me to the last cell that contains a
look-up formula linked to the database extraction, which is well below where
the last actual date is. i.e. I need to get to the cell with a maximum value
- have tried writing various IF statements to make the cell values zero or "
", but it seems to make no difference and always goes to the last cell in the
column containing a formula. I have tried various ways of using MAX but keep
getting syntax errors, as it's apparently not as simple as using MAX(A1:A400)
in a cell formula, or am I missing something simple here? Can anyone offer
any further help on this please?