ho due istruzioni che girano bene se sono collocate su file di excel separati.
Lavorano su due datebase differenti di 75 gg lavorativi ciascuno.
Se fanno parte di uno stesso file su fogli di excel ovviamente differenti:una istruzione va in "errore
di run time 13 tipo non corrispondente". Non capisco perchè.
Le due istruzioni sono identiche ma variano solo come sottoindicato da questa istruzione
ripetuta per l'intero elenco
If CEL.Value = "Pippo1" Then sostituita per l'intero elenco da: If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2 CEL.Font.ColorIndex = 1
End If CEL.Font.FontStyle = "Normale"
End If
Questa è una delle due istruzioni:
- Codice: Seleziona tutto
Sub Bianchetto()
Sheets("Turno").Select
Dim nome(20) As String
nome(1) = "Pippo1"
nome(2) = "Pippo1"
nome(3) = "Pippo1"
nome(4) = "Pippo1"
nome(5) = "Pippo1"
nome(6) = "Pippo1"
nome(7) = "Pippo1"
nome(8) = "Pippo1"
nome(9) = "Pippo1"
nome(10) = "Pippo1"
nome(11) = "Pippo1"
nome(12) = "Pippo1"
nome(13) = "Pippo1"
nome(14) = "Pippo1"
nome(15) = "Pippo1"
nome(16) = "Pippo1"
nome(17) = "Pippo1"
nome(18) = "Pippo1"
nome(19) = "Pippo1"
nome(20) = "Pippo1"
Set zona = Range("A3:U203") 'campo entro cui ricercare la giornata o treno
For Each CEL In zona 'per ogni CEL( Oggetto cella) nel Range "zona"
If CEL.Value = "Pippo1" Then'
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 0
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
If CEL.Value = "Pippo1" Then
CEL.Font.ColorIndex = 2
End If
Next
End Sub