
Dim i As Integer For i = 2 To 21 Step 3 If Cells(i, 4) = "gino" Then Cells(i, 6)= "presente" End If Next i |
Option Explicit
Option Compare Text ' casomai la X fosse sia maiuscola che minuscola
Sub verifica()
Dim Ur1 As Long, Y As Long, I As Long, Fine As Long
Ur1 = Range("A" & Rows.Count).End(xlUp).Row
Y = 2
For I = Y To Ur1
Ricomincia:
Fine = Y + 18
For Y = I To Fine Step 3
If Cells(Y, 2) = "x" Then
Cells(Y, 3) = "presente"
End If
Next Y
Y = Y + 7
I = Y
If I < Ur1 Then GoTo Ricomincia
Next I
MsgBox "fatto"
End Sub |
Option Explicit
Option Compare Text ' casomai la X fosse sia maiuscola che minuscola
Sub verifica()
Dim Ur1 As Long, Y As Long, I As Long, Fine As Long, X As Long
Ur1 = Range("A" & Rows.Count).End(xlUp).Row
Y = 2
For I = Y To Ur1
Ricomincia:
Fine = Y + 18
For Y = I To Fine Step 3
If Cells(Y, 2) = "x" Then
Cells(Y, 3) = "presente"
For X = 4 To 18
If (X - 1) Mod 2 = 0 Then Cells(Y, X) = 8 Else Cells(Y, X) = 5
Next X
End If
Next Y
Y = Y + 7
I = Y
If I < Ur1 Then GoTo Ricomincia
Next I
MsgBox "fatto"
End Sub |
Option Explicit
Option Compare Text ' casomai la X fosse sia maiuscola che minuscola
Sub verifica()
Dim Ur1 As Long, Y As Long, I As Long, Fine As Long, X As Long, D_P As Long
Ur1 = Range("A" & Rows.Count).End(xlUp).Row
Y = 2
For I = Y To Ur1
Ricomincia:
Fine = Y + 18
For Y = I To Fine Step 3
If Cells(Y, 2) = "x" Then
Cells(Y, 3) = "presente"
For X = 4 To 18
If (D_P + X) Mod 2 = 0 Then Cells(Y, X) = 8 Else Cells(Y, X) = 5
Next X
End If
Next Y
D_P = D_P + 1
Y = Y + 7
I = Y
If I < Ur1 Then GoTo Ricomincia
Next I
MsgBox "fatto"
End Sub |
Option Explicit
Option Compare Text ' casomai la X fosse sia maiuscola che minuscola
Sub verifica()
Dim Ur1 As Long, Y As Long, I As Long, Fine As Long, X As Long, C As Object
Ur1 = Range("A" & Rows.Count).End(xlUp).Row
Y = 2
For I = Y To Ur1
Ricomincia:
Fine = Y + 18
Set C = Range(Cells(Y - 1, 3), Cells(Y - 1, 10)).Find("dom", LookAt:=xlWhole)
For Y = I To Fine Step 3
If Cells(Y, 2) = "x" Then
Cells(Y, 3) = "presente"
Range(Cells(Y, 4), Cells(Y, 10)) = "L"
Cells(Y, C.Column) = "F"
End If
Next Y
Y = Y + 7
I = Y
If I < Ur1 Then GoTo Ricomincia
Next I
MsgBox "fatto"
Set C = Nothing
End Sub |
Option Explicit
Option Compare Text ' casomai la X fosse sia maiuscola che minuscola
Sub verifica()
Dim Ur1 As Long, Y As Long, I As Long, Fine As Long, X As Long, C As Object
Ur1 = Range("A" & Rows.Count).End(xlUp).Row
Y = 2
For I = Y To Ur1
Ricomincia:
Fine = Y + 18
Set C = Range(Cells(Y - 1, 3), Cells(Y - 1, 10)).Find("dom", LookAt:=xlWhole)
For Y = I To Fine Step 3
If Cells(Y, 2) = "x" Then
Cells(Y, 3) = "presente"
If Range(Cells(Y, 4), Cells(Y, 10)) <> "" Then
Range(Cells(Y, 4), Cells(Y, 10)) = "L"
Cells(Y, C.Column) = "F"
End If
End If
Next Y
Y = Y + 7
I = Y
If I < Ur1 Then GoTo Ricomincia
Next I
MsgBox "fatto"
Set C = Nothing
End Sub
|
Option Explicit
Option Compare Text ' casomai la X fosse sia maiuscola che minuscola
Sub verifica()
Dim Ur1 As Long, Y As Long, I As Long, Fine As Long, X As Long, C As Object, N As Long
Ur1 = Range("A" & Rows.Count).End(xlUp).Row
Y = 2
For I = Y To Ur1
Ricomincia:
Fine = Y + 18
Set C = Range(Cells(Y - 1, 3), Cells(Y - 1, 10)).Find("dom", LookAt:=xlWhole)
For Y = I To Fine Step 3
If Cells(Y, 2) = "x" Then
Cells(Y, 3) = "presente"
For X = 4 To 10
If Cells(Y, X) = "" Then N = N + 1
Next X
If N = 7 Then
Range(Cells(Y, 4), Cells(Y, 10)) = "L"
Cells(Y, C.Column) = "F"
End If
N = 0
End If
Next Y
Y = Y + 7
I = Y
If I < Ur1 Then GoTo Ricomincia
Next I
MsgBox "fatto"
Set C = Nothing
End Sub |
Option Explicit
Option Compare Text ' casomai la X fosse sia maiuscola che minuscola
Sub verifica()
Dim Ur1 As Long, Y As Long, I As Long, Fine As Long, X As Long, N As Long
Ur1 = Range("A" & Rows.Count).End(xlUp).Row
N = 1
Y = 2
For I = Y To Ur1
Ricomincia:
Fine = Y + 18
For Y = I To Fine Step 3
If Cells(Y, 2) = "X" Then
Cells(Y, 3) = "presente"
For X = 4 To 10
If Cells(N, X) = "" Then
Cells(Y, X) = ""
ElseIf Cells(N, X) = "Dom" Then
Cells(Y, X) = "F"
ElseIf Cells(N, X) <> "Dom" Then
Cells(Y, X) = "L"
End If
Next X
End If
Next Y
N = N + 28
Y = Y + 7
I = Y
If I < Ur1 Then GoTo Ricomincia
Next I
MsgBox "fatto"
End Sub |
