Ideally there would be a column that has the date in it. Then you could do an advanced filter to filter on the date range that you require. Selecting the last 31 days will not always select just one month. It may select up to 3 days from the previous month as well.
Public Sub selectLastMonth()
Dim ws As Worksheet
Dim dStart As Date, dEnd As Date
Set ws = ActiveSheet
ws.Range("A:B").Sort key1:=ws.Range("A2"), header:=xlYes
dEnd = ws.Range("A1").End(xlDown).Value
dStart = DateSerial(DatePart("yyyy", dEnd), DatePart("m", dEnd), 1)
ws.Range("A:B").AutoFilter field:=1, Criteria1:=">=" & dStart, Operator:=xlAnd, Criteria2:="<=" & dEnd
Set ws = Nothing
End Sub