Pessoal, bom dia!
Além do código abaixo não funcionar corretamente, como eu faço para simplificar a média de todos esses Txt's?
Eu preciso fazer a média dos 72 Txt's. Vide meu código paliativo:
Sub Calc_Media_Prensada()
Dim A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19 As Double
Dim B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13, B14, B15, B16, B17, B18, B19 As Double
Dim C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19 As Double
Dim D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15, D16, D17, D18, D19 As Double
A1 = Val(Me.Txt_Chapa01_01.Text)
A2 = Val(Me.Txt_Chapa01_02.Text)
A3 = Val(Me.Txt_Chapa01_03.Text)
A4 = Val(Me.Txt_Chapa01_04.Text)
A5 = Val(Me.Txt_Chapa01_05.Text)
A6 = Val(Me.Txt_Chapa01_06.Text)
A7 = Val(Me.Txt_Chapa01_07.Text)
A8 = Val(Me.Txt_Chapa01_08.Text)
A9 = Val(Me.Txt_Chapa01_09.Text)
A10 = Val(Me.Txt_Chapa01_10.Text)
A11 = Val(Me.Txt_Chapa01_11.Text)
A12 = Val(Me.Txt_Chapa01_12.Text)
A13 = Val(Me.Txt_Chapa01_13.Text)
A14 = Val(Me.Txt_Chapa01_14.Text)
A15 = Val(Me.Txt_Chapa01_15.Text)
A16 = Val(Me.Txt_Chapa01_16.Text)
A17 = Val(Me.Txt_Chapa01_17.Text)
A18 = Val(Me.Txt_Chapa01_18.Text)
B1 = Val(Me.Txt_Chapa01_19.Text)
B2 = Val(Me.Txt_Chapa01_20.Text)
B3 = Val(Me.Txt_Chapa01_21.Text)
B4 = Val(Me.Txt_Chapa01_22.Text)
B5 = Val(Me.Txt_Chapa01_23.Text)
B6 = Val(Me.Txt_Chapa01_24.Text)
B7 = Val(Me.Txt_Chapa01_25.Text)
B8 = Val(Me.Txt_Chapa01_26.Text)
B9 = Val(Me.Txt_Chapa01_27.Text)
B10 = Val(Me.Txt_Chapa01_28.Text)
B11 = Val(Me.Txt_Chapa01_29.Text)
B12 = Val(Me.Txt_Chapa01_30.Text)
B13 = Val(Me.Txt_Chapa01_31.Text)
B14 = Val(Me.Txt_Chapa01_32.Text)
B15 = Val(Me.Txt_Chapa01_33.Text)
B16 = Val(Me.Txt_Chapa01_34.Text)
B17 = Val(Me.Txt_Chapa01_36.Text)
B18 = Val(Me.Txt_Chapa01_36.Text)
C1 = Val(Me.Txt_Chapa02_01.Text)
C2 = Val(Me.Txt_Chapa02_02.Text)
C3 = Val(Me.Txt_Chapa02_03.Text)
C4 = Val(Me.Txt_Chapa02_04.Text)
C5 = Val(Me.Txt_Chapa02_05.Text)
C6 = Val(Me.Txt_Chapa02_06.Text)
C7 = Val(Me.Txt_Chapa02_07.Text)
C8 = Val(Me.Txt_Chapa02_08.Text)
C9 = Val(Me.Txt_Chapa02_09.Text)
C10 = Val(Me.Txt_Chapa02_10.Text)
C11 = Val(Me.Txt_Chapa02_11.Text)
C12 = Val(Me.Txt_Chapa02_12.Text)
C13 = Val(Me.Txt_Chapa02_13.Text)
C14 = Val(Me.Txt_Chapa02_14.Text)
C15 = Val(Me.Txt_Chapa02_15.Text)
C16 = Val(Me.Txt_Chapa02_16.Text)
C17 = Val(Me.Txt_Chapa02_17.Text)
C18 = Val(Me.Txt_Chapa02_18.Text)
D1 = Val(Me.Txt_Chapa02_19.Text)
D2 = Val(Me.Txt_Chapa02_20.Text)
D3 = Val(Me.Txt_Chapa02_21.Text)
D4 = Val(Me.Txt_Chapa02_22.Text)
D5 = Val(Me.Txt_Chapa02_23.Text)
D6 = Val(Me.Txt_Chapa02_24.Text)
D7 = Val(Me.Txt_Chapa02_25.Text)
D8 = Val(Me.Txt_Chapa02_26.Text)
D9 = Val(Me.Txt_Chapa02_27.Text)
D10 = Val(Me.Txt_Chapa02_28.Text)
D11 = Val(Me.Txt_Chapa02_29.Text)
D12 = Val(Me.Txt_Chapa02_30.Text)
D13 = Val(Me.Txt_Chapa02_31.Text)
D14 = Val(Me.Txt_Chapa02_32.Text)
D15 = Val(Me.Txt_Chapa02_33.Text)
D16 = Val(Me.Txt_Chapa02_34.Text)
D17 = Val(Me.Txt_Chapa02_36.Text)
D18 = Val(Me.Txt_Chapa02_36.Text)
Txt_Analise_MedPrensada = FormatNumber((A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10 + A11 + A12 + A13 + A14 + A15 + A16 + A17 + A18 + B1 + B2 + B3 + B4 + B5 + B6 + B7 + B8 + B9 + B10 + B11 + B12 + B13 + B14 + B15 + B16 + B17 + B18 + C1 + C2 + C3 + C4 + C5 + C6 + C7 + C8 + C9 + C10 + C11 + C12 + C13 + C14 + C15 + C16 + C17 + C18 + D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10 + D11 + D12 + D13 + D14 + D15 + D16 + D17 + D18) / 72, 1)
End Sub
Obrigado pela ajuda!
Postado : 03/07/2017 5:30 am