'Find cells from last month VBA
First time asking a question here. I'm very new to VBA and therefore struggling.
I have 3 columns where I list up dates when I have completed a task. I need to find a way to save all information from last month to a PDF with a push of a button.
But, I can't find a way to only select cells from last month using VBA, and ignoring the cells from current month.
[Date][Names][Results]
Solution 1:[1]
Export Last Month to PDF
Option Explicit
Sub ExportLastMonthToPDF()
With ActiveSheet
If .FilterMode Then .ShowAllData
With .Range("A1").CurrentRegion
.AutoFilter Field:=1, Criteria1:=8, Operator:=xlFilterDynamic
End With
.ExportAsFixedFormat xlTypePDF, "C:\Test\Test.pdf"
.AutoFilterMode = False
End With
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | VBasic2008 |
