Hi All below is a piece of code that I am trying to get to work, the idea is that it send emails based on some cells value. I am getting the error on the lines marked with ***, any help will be appreciated.
Thanks,
Sub emailtest3()
'
' emailtest3 Macro
'
'
Dim r As Range
Set r = Sheets("Pivot").Cells
For i = 20 To 200
Range("B1").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("SO Number").ClearAllFilters
*** ActiveSheet.PivotTables("PivotTable1").PivotFields("SO Number").CurrentPage = _
*** OO2018.Range("AS" & i).Value
ActiveWorkbook.EnvelopeVisible = True
With r.Parent.MailEnvelope.Item
.To = OO2018.Range("AX" & i).Value
.CC = ""
.BCC = ""
.Subject = OO2018.Range("AW" & i).Value
.Send
End With
Next i
End Sub
Bookmarks