Dim i(1 To 3, 1 To 2) As Single
Dim kderadek%, kdesloupec%, oblast%, f%
Dim hodnota$
i(1, 1) = 1: i(1, 2) = 5
i(2, 1) = 7: i(2, 2) = 11
i(3, 1) = 13: i(3, 2) = 17
kderadek = ActiveCell.Row
kdesloupec = ActiveCell.Column
oblast = 0
hodnota = ""
Select Case kderadek
Case Is <= 5: oblast = 1
Case 7 To 11: oblast = 2
Case 13 To 17: oblast = 3
End Select
If (kdesloupec = 1 Or kdesloupec = 4) And oblast > 0 Then
For f = i(oblast, 1) To i(oblast, 2)
hodnota = hodnota & Cells(f, 1) & " " & Cells(f, 4) & vbCrLf
Next f
Else
hodnota = "nic!"
End If
MsgBox (hodnota)
End Subcitovat