View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andrew Taylor Andrew Taylor is offline
external usenet poster
 
Posts: 225
Default Dynamic MAX formula

In the second line you don't need the quote before A7: it should be

ActiveCell.Formula = "=MAX(A7:A" & Selection.CurrentRegion.Rows.Count
& ")"

I suspect the formula still isn't quite doing what you want though
- maybe it should be something like:

ActiveCell.Formula = "=MAX(A7:A" & (Selection.CurrentRegion.Rows.Count
+5) & ")"



On 23 Sep, 15:41, Ludo wrote:
Hi,

I'm looking for a way to have the MAX & MIN values of a dynamic range.

This one gives me a compile error

* * Range("A5").Select
* * ActiveCell.Formula ="=MAX("A7:A" &
selection.currentregion.rows.count)"

any help welcome
Regards,
Ludo