
Option Explicit
Sub POM()
Dim MyRange As Range, cell As Range, stary As Long, novy As Long, Msg As String
Set MyRange = Range("A1", Cells(Cells.SpecialCells(xlCellTypeLastCell).Row, 1))
stary = 0
For Each cell In MyRange
If Rows(cell.Row).Hidden = False Then
novy = cell.Row
If novy - stary > 1 Then
Msg = MsgBox("Číslo riadku je: " & novy, vbOKOnly)
Exit Sub
Else: stary = novy
End If
End If
Next cell
End Sub