How to Send Auto-mail for Specific Column based on Column Value

gssachin

Board Regular
Joined
Nov 14, 2013
Messages
127
Hi,

I have an excel sheet which having 60 rows (aprrox. which will change every time) and 10 column of data
In Column 11 I have stored Location (i.e. "Class A", "Class B", "Class C" etc)

For example : Suppose Column 11 having 4 Categories then I want to send 4 emails, after selecting/filtering data for for each category.

Please help me....
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

gssachin

Board Regular
Joined
Nov 14, 2013
Messages
127
I have following macro but getting error "Application-defined or object-defined error"

Sub MACRO1()
Dim i As Integer
Dim R As Range
Set R = Sheets("PIVOT").Cells


For i = 2 To 6


Range("B1").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("LOCATION").ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields("LOCATION").CurrentPage = _
Sheet2.Range("A" & i).Value


ActiveWorkbook.EnvelopeVisible = True


With R.Parent.MailEnvelope.Item
.To = Sheet1.Range("B" & i).Value
.cc = ""
.bcc = ""
.Subject = "Various allowance paid"
.send
End With


Next i


End Sub

can anybody help on this....
 

Watch MrExcel Video

Forum statistics

Threads
1,109,488
Messages
5,529,164
Members
409,852
Latest member
Perry123
Top