Simplificar codigo initialize

Para "dante amor"

Aqui te dejo las lineas del codigo initialize para simplificar!

Gracias

pes1.Locked = True
pes2.Locked = True
pes3.Locked = True
pes4.Locked = True
pes5.Locked = True
pes6.Locked = True
pes7.Locked = True
pes8.Locked = True
pes9.Locked = True
pes10.Locked = True
pes11.Locked = True
pes12.Locked = True
pes13.Locked = True
pes14.Locked = True
pes15.Locked = True
pes16.Locked = True
pes17.Locked = True
pes18.Locked = True
pes19.Locked = True
pes20.Locked = True
pes21.Locked = True
pes22.Locked = True
pes23.Locked = True
pesx1.Locked = True
pesx2.Locked = True
pesx3.Locked = True
K1 = "0"
k2 = "0"
k3 = "0"
k4 = "0"
k5 = "0"
k6 = "0"
k7 = "0"
k8 = "0"
k9 = "0"
k10 = "0"
k11 = "0"
k12 = "0"
k13 = "0"
k14 = "0"
k15 = "0"
k16 = "0"
k17 = "0"
k18 = "0"
k19 = "0"
k20 = "0"
k21 = "0"
k22 = "0"
k23 = "0"
kx1 = "0"
kx2 = "0"
kx3 = "0"
st1.Locked = True
st2.Locked = True
st3.Locked = True
st4.Locked = True
st5.Locked = True
st6.Locked = True
st7.Locked = True
st8.Locked = True
st9.Locked = True
st10.Locked = True
st11.Locked = True
st12.Locked = True
st13.Locked = True
st14.Locked = True
st15.Locked = True
st16.Locked = True
st17.Locked = True
st18.Locked = True
st19.Locked = True
st20.Locked = True
st21.Locked = True
st22.Locked = True
st23.Locked = True
stx1.Locked = True
stx2.Locked = True
stx3.Locked = True
w_tot = w_st1 + w_st2 + w_st3 + w_st4
    stotal.Value = Format(w_tot, "$ #,##0.00")

Respuesta
2

Te anexo el código

 '--------------------------------------------------
    For i = 1 To 23
        Me.Controls("pes" & i).Locked = True
        Me.Controls("st" & i).Locked = True
        Me.Controls("k" & i).Value = 0
    Next
    For i = 1 To 3
        Me.Controls("stx" & i).Locked = True
        Me.Controls("pesx" & i).Locked = True
        Me.Controls("kx" & i).Value = 0
    Next
    '
    w_tot = w_st1 + w_st2 + w_st3 + w_st4
        stotal.Value = Format(w_tot, "$ #,##0.00")
    '

Sal u dos

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas