Re: Finding Maximum Within Range (Looped)
- From: "Die_Another_Day" <charles_suzyq@xxxxxxxxx>
- Date: 8 Sep 2006 06:12:47 -0700
I think Count2 needs to be initialized as 1
Count2 = 1
For q = 0 To span Step delta 'loop for calculating max of each column
Max = Application.Max(Cells(21, Count2), Cells(100, Count2))
Cells(19, Count2 + 2) = Max
Count2 = Count2 + 1
Next q
You can also asign a formula to the cell:
Count2 = 1
For q = 0 To span Step delta 'loop for calculating max of each column
Cells(19, Count2 + 2).FormulaR1C1 = "=Max(R21C" & Count2 &
":R100C" _
& Count2 & ")"
Count2 = Count2 + 1
Next q
Charles Chickering
Jacob wrote:
There is an error with the 3rd line of the code below, and I cannot
figure out why. I guess I don't understand how to use "Range" with
indexing very well. Is there a better way to go about this?
thanks.
Count2 = 0
For q = 0 To span Step delta 'loop for calculating max of each column
Max = Application.Max(Range(Cells(21, Count2), Cells(100, Count2)))
Cells(19, Count2 + 2) = Max
Count2 = Count2 + 1
Next q
.
- Follow-Ups:
- Re: Finding Maximum Within Range (Looped)
- From: Jacob
- Re: Finding Maximum Within Range (Looped)
- References:
- Finding Maximum Within Range (Looped)
- From: Jacob
- Finding Maximum Within Range (Looped)
- Prev by Date: Re: Solver Error
- Next by Date: Re: Max *** Threshold
- Previous by thread: Finding Maximum Within Range (Looped)
- Next by thread: Re: Finding Maximum Within Range (Looped)
- Index(es):