Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Option Explicit
  2. Sub Makró1()
  3.  
  4.  
  5. Dim ActualMonth As String
  6. Dim ActualMonthDate As Long
  7. ActualMonth = ActiveSheet.Range("A3") ' MEGKERESI AZ AKTUÁLIS HÓNAP NEVÉT
  8. ActualMonthDate = Application.WorksheetFunction.VLookup((ActualMonth), Sheets("SZÁMÍTÁSHOZ").Range("TBL_MONTH"), 3, False) ' A SEGÉDTÁBLÁBÓL KIKERESI AZ AKTUÁLIS HÓNAP ELSŐ NAPJÁT
  9.  
  10. Dim a As Long
  11. Dim lLastrow As Long
  12. Dim Header As Long
  13. Dim lDate As Long
  14.  
  15. Header = 6 'fejléc, ez után vizsgál
  16. lDate = ActualMonthDate 'ez alapján vizsgál
  17. lLastrow = Cells(Rows.Count, 10).End(xlUp).Row ' utolsó sor az I oszlop adatai alapján, eddig vizsgál
  18.  
  19. For a = Header + 1 To lLastrow 'leszalad a 7. sortól az utolsóig
  20. If Cells(a, 10) < lDate And Cells(a, 10) <> "" Then 'ha az adott sor I oszlop metszetében lévő cella kisebb mint a megadott dátum, akkor..
  21. Cells(a, 1).Clear 'kitörli belőle az adatot
  22. End If
  23. Next a
  24.  
  25.  
  26. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement