DIVISAO HORAS COM PORCENTAGEM
bom dia amigos, consegui resolver o problema, muito obrigado aos amigos que me ajudaram,
Private Sub Cal_porcentagem_Click()
Dim D, e, f, g, h As Date, TB, tb1, tb2, tb3, tb4, Res, res1, res2, res3, res4, res5, res6, res7 As String
D = txthora1.Text
e = txthora2.Text
f = txthora3.Text
g = txthora4.Text
h = txthoratotal.Text
TB = Split(D, [Ô]:[Ô])
tb1 = Split(e, [Ô]:[Ô])
tb2 = Split(f, [Ô]:[Ô])
tb3 = Split(g, [Ô]:[Ô])
tb4 = Split(h, [Ô]:[Ô])
Res = TB(0) + ((TB(1) * 100) / 60) / 100
res1 = tb4(0) + ((tb4(1) * 100) / 60) / 100
res2 = tb1(0) + ((tb1(1) * 100) / 60) / 100
res3 = tb4(0) + ((tb4(1) * 100) / 60) / 100
res4 = tb2(0) + ((tb2(1) * 100) / 60) / 100
res5 = tb4(0) + ((tb4(1) * 100) / 60) / 100
res6 = tb3(0) + ((tb3(1) * 100) / 60) / 100
res7 = tb4(0) + ((tb4(1) * 100) / 60) / 100
pc1.Text = ((Res / res1) * 100)
pc1.Text = Format(pc1.Text, [Ô]0.00[Ô]) & [Ô]%[Ô]
pc2.Text = ((res2 / res3) * 100)
pc2.Text = Format(pc2.Text, [Ô]0.00[Ô]) & [Ô]%[Ô]
pc3.Text = ((res4 / res5) * 100)
pc3.Text = Format(pc3.Text, [Ô]0.00[Ô]) & [Ô]%[Ô]
pc4.Text = ((res6 / res7) * 100)
pc4.Text = Format(pc4.Text, [Ô]0.00[Ô]) & [Ô]%[Ô]
End Sub
Att
Luiz
Private Sub Cal_porcentagem_Click()
Dim D, e, f, g, h As Date, TB, tb1, tb2, tb3, tb4, Res, res1, res2, res3, res4, res5, res6, res7 As String
D = txthora1.Text
e = txthora2.Text
f = txthora3.Text
g = txthora4.Text
h = txthoratotal.Text
TB = Split(D, [Ô]:[Ô])
tb1 = Split(e, [Ô]:[Ô])
tb2 = Split(f, [Ô]:[Ô])
tb3 = Split(g, [Ô]:[Ô])
tb4 = Split(h, [Ô]:[Ô])
Res = TB(0) + ((TB(1) * 100) / 60) / 100
res1 = tb4(0) + ((tb4(1) * 100) / 60) / 100
res2 = tb1(0) + ((tb1(1) * 100) / 60) / 100
res3 = tb4(0) + ((tb4(1) * 100) / 60) / 100
res4 = tb2(0) + ((tb2(1) * 100) / 60) / 100
res5 = tb4(0) + ((tb4(1) * 100) / 60) / 100
res6 = tb3(0) + ((tb3(1) * 100) / 60) / 100
res7 = tb4(0) + ((tb4(1) * 100) / 60) / 100
pc1.Text = ((Res / res1) * 100)
pc1.Text = Format(pc1.Text, [Ô]0.00[Ô]) & [Ô]%[Ô]
pc2.Text = ((res2 / res3) * 100)
pc2.Text = Format(pc2.Text, [Ô]0.00[Ô]) & [Ô]%[Ô]
pc3.Text = ((res4 / res5) * 100)
pc3.Text = Format(pc3.Text, [Ô]0.00[Ô]) & [Ô]%[Ô]
pc4.Text = ((res6 / res7) * 100)
pc4.Text = Format(pc4.Text, [Ô]0.00[Ô]) & [Ô]%[Ô]
End Sub
Att
Luiz
Tópico encerrado , respostas não são mais permitidas