Public Sub Zkontroluj()
For rdi = 6 To Hárok9.UsedRange.Rows.Count
If Cells(rdi, 14) <> "" Then
For rdo = 6 To Hárok9.UsedRange.Rows.Count
If Cells(rdo, 3) = Cells(rdi, 14) Then
Cells(rdo, 5) = Cells(rdi, 15)
Zaskrtni (rdo)
Exit For
Else
If Cells(rdo, 3) = "" Then
Cells(rdo, 3) = Cells(rdi, 14)
Cells(rdo, 5) = Cells(rdi, 15)
Zaskrtni (rdo)
Exit For
End If
End If
Next
Else
Exit For
End If
Next
End Sub
Public Sub Zaskrtni(radek As Single)
For Each cb In Hárok9.CheckBoxes
If UCase(Left(cb.Name, 9)) = "CHECK BOX" Then
If (cb.Left >= Cells(radek, 1).Left And cb.Left < Cells(radek, 2).Left) And (cb.Top >= Cells(radek, 1).Top And cb.Top < Cells(radek + 1, 1).Top) Then
cb.Value = True
End If
End If
Next
End Sub
M@citovat