montecarlo2012
Well-known Member
- Joined
- Jan 26, 2011
- Messages
- 985
- Office Version
- 2010
- Platform
- Windows
Hello.
I tried to use trunc here but do not work
what I am doing wrong.
thank you for reading.
VBA Code:
Sub RwData(rng As Range, col As Integer)
Dim Dn As Range
For Each Dn In rng
With Application
Dn.Offset(, -5) = .Max(Dn.Resize(, .CountA(Dn.Resize(, col)))) 'column H or 8 - is minus 5 from 13 or column M
Dn.Offset(, -3) = .Average(Dn.Resize(, .CountA(Dn.Resize(, col)))) 'this is colum J or 10 [or -3 from 13]
Dn.Offset(, -2) = Dn - .Average(Dn.Resize(, .CountA(Dn.Resize(, col)))) 'column K or -2 from 13
End With
Next Dn
End Sub
VBA Code:
Dn.Offset(, -3) =.trunc( .Average(Dn.Resize(, .CountA(Dn.Resize(, col)))))
thank you for reading.