
Sub movimenti() Dim Foglio1 As Worksheet For Each Worksheet In Worksheets If Worksheet.Name = "Foglio1" Then Set Foglio1 = Worksheet End If Next Dim count, i, j As Integer count = 2 i = 1 j = 0 While Foglio1.Cells(conut, 3).Value <> "" If Foglio1.Cells(16, i).Value = "SCARICO LINEA" Then i = i + 1 End If If Foglio1.Cells(16, i).Value = "RESO LINEA" Then j = j + 1 End If Wend End Sub |
Sub movimenti() riga = 2 While Cells(riga, "F").Value <> "" If Cells(riga, "F").Value = "SCARICO LINEA" Then i = i + 1 End If If Cells(riga, "F").Value = "RESO DA LINEA" Then j = j + 1 End If riga = riga + 1 Wend MsgBox "scarico " & i & " - Reso " & j End Sub |
Sub movimenti()
Worksheets("Foglio1").Activate
i = 2
contascarico = 0
contareso = 0
ActiveSheets.Cells(i, 18).Select
Do Until Active.Cell.Text = ""
If ActiveCell.Text = "SCARICO LINEA" Then
contascarico = contascarico + 1
End If
If ActiveCell.Text = "RESO DA LINEA" Then
contareso = contareso + 1
End If
i = i + 1
ActiveSheet.Cells(i, 18).Select
Loop
ActiveSheet.Cells(6, 55).Select
Cells(7, 55) = contascarico
Cells(8, 55) = contareso
End Sub
|
