Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Sub Makró1()
- Dim ActualMonth As String
- Dim ActualMonthDate As Long
- ActualMonth = ActiveSheet.Range("A3") ' MEGKERESI AZ AKTUÁLIS HÓNAP NEVÉT
- 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
- Dim a As Long
- Dim lLastrow As Long
- Dim Header As Long
- Dim lDate As Long
- Header = 6 'fejléc, ez után vizsgál
- lDate = ActualMonthDate 'ez alapján vizsgál
- lLastrow = Cells(Rows.Count, 10).End(xlUp).Row ' utolsó sor az I oszlop adatai alapján, eddig vizsgál
- For a = Header + 1 To lLastrow 'leszalad a 7. sortól az utolsóig
- 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..
- Cells(a, 1).Clear 'kitörli belőle az adatot
- End If
- Next a
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement