Guest User

sortorlo_makro

a guest
Feb 28th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Sub Sortorlo_xy()
  2.  
  3. Dim Lr As Long
  4. Dim i As Long
  5.  
  6. Lr = Range("A" & Rows.Count).End(xlUp).Row
  7. For i = 1 To Lr
  8. If Range("A" & i).Value = "xy" Then
  9. If i = 1 Then Exit Sub
  10. Range("A1:A" & i - 1).EntireRow.Delete
  11. MsgBox "Az első " & i - 1 & " sor törölve."
  12. Exit Sub
  13. End If
  14. Next i
  15. MsgBox "Nincs olyan cella az A oszlopban, aminek értéke ""xy""."
  16.  
  17. End Sub
Advertisement
Add Comment
Please, Sign In to add comment