montecarlo2012
Well-known Member
- Joined
- Jan 26, 2011
- Messages
- 986
- Office Version
- 2010
- Platform
- Windows
Hello all.
Working on:
wondering how to shorter this 4 loops.
Please, your feedback is very important
Thank you for reading this.
Working on:
VBA Code:
sub regre_an ()
Dim H, Z$()
For Each H In Split("B4:B2 B20:B18 B36:B34 B52:B50 B68:B66 B84:B82")
Z = Split(H, ":")
Range(Z(0)).Value2 = Application.Average(Range(Z(1), Range(Z(1)).End(xlToRight)))
Next
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Dim V, S$()
For Each V In Split("B5:B2 B21:B18 B37:B34 B53:B50 B69:B66 B85:B82")
S = Split(V, ":")
Range(S(0)).Value2 = Application.Count(Range(S(1), Range(S(1)).End(xlToRight)))
Next
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Dim M, N$()
For Each M In Split("B6:B2 B22:B18 B38:B34 B54:B50 B70:B66 B86:B82")
N = Split(M, ":")
Range(N(0)).Value2 = Application.Max(Range(N(1), Range(N(1)).End(xlToRight)))
Next
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Dim X, E$()
For Each X In Split("B7:B2 B23:B18 B39:B34 B55:B50 B71:B66 B87:B82")
E = Split(X, ":")
Range(E(0)).Value2 = Application.Mode(Range(E(1), Range(E(1)).End(xlToRight)))
Next
end sub
wondering how to shorter this 4 loops.
Please, your feedback is very important
Thank you for reading this.