Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim myTab19 As String
- myTab19 = "l41:r69"
- If Not Application.Intersect(Target, Range(myTab19)) Is Nothing And Sheets("Barbaro").Range("b8").Value <> 0 Then
- Range(myTab19).Copy Destination:=Sheets("tiri nascosti").Range("h29")
- End If
- Dim Indice As Integer
- Dim Indice01 As Integer
- Dim Indice02 As Integer
- Dim Vettore(1 To 10, 1 To 2)
- Dim Risultati(1 To 10, 1 To 2)
- Dim CellaW
- Risultati(1, 1) = "Barbaro"
- Set Risultati(1, 2) = ActiveWorkbook.Sheets("mod").Range("L2:L21")
- Risultati(2, 1) = "Guerriero"
- Set Risultati(2, 2) = ActiveWorkbook.Sheets("mod").Range("L24:L43")
- Risultati(3, 1) = "Monaco"
- Set Risultati(3, 2) = ActiveWorkbook.Sheets("mod").Range("L46:L65")
- Risultati(4, 1) = "Stregone"
- Set Risultati(4, 2) = ActiveWorkbook.Sheets("mod").Range("L68:L87")
- Risultati(5, 1) = "Bardo"
- Set Risultati(5, 2) = ActiveWorkbook.Sheets("mod").Range("O2:O21")
- Risultati(6, 1) = "Ladro"
- Set Risultati(6, 2) = ActiveWorkbook.Sheets("mod").Range("O24:O43")
- Risultati(7, 1) = "Paladino"
- Set Risultati(7, 2) = ActiveWorkbook.Sheets("mod").Range("O45:O65")
- Risultati(8, 1) = "Druido"
- Set Risultati(8, 2) = ActiveWorkbook.Sheets("mod").Range("R2:R21")
- Risultati(9, 1) = "Mago"
- Set Risultati(9, 2) = ActiveWorkbook.Sheets("mod").Range("R24:R43")
- Risultati(10, 1) = "Ranger"
- Set Risultati(10, 2) = ActiveWorkbook.Sheets("mod").Range("R46:R65")
- For Indice = 1 To 10
- Vettore(Indice, 1) = ActiveWorkbook.Sheets("Barbaro").Range("C38").Offset((Indice) * 3, 1)
- Vettore(Indice, 2) = ActiveWorkbook.Sheets("Barbaro").Range("C38").Offset((Indice) * 3, 9)
- If Not IsNumeric(Vettore(Indice, 2)) Then
- MsgBox "livello non numerico"
- Exit Sub
- End If
- Next Indice
- For Indice01 = 1 To 10
- For Indice02 = 1 To 10
- If Risultati(Indice01, 1) = Vettore(Indice02, 1) Then
- For Each CellaW In Risultati(Indice01, 2)
- If CellaW.Value <= Vettore(Indice02, 2) Then
- If CellaW.Offset(0, 1) <> "" Then
- ActiveWorkbook.Sheets("Barbaro2").Range("H52").End(xlUp).Offset(1, 0) = CellaW.Offset(0, 1).Text
- End If
- End If
- Next CellaW
- End If
- Next Indice02
- Next Indice01
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement