Macro to change values of a cell and send e-mail

Erdalu

New Member
Joined
Feb 25, 2015
Messages
1
Hello all,

I have searched an answer for my question but couldn't find one. Please excuse me if there was a similar one.

Right now my excel file can create PDF and send e-mails thanks to Ron de Bruin's add-in.

What I do is, I change the value of one specific cell manually which updates the worksheet and then click the button initiating the macro.

Problem is that I have to do this process 300 times. Change cell, click button, send e-mail, change cell, click button, send e-mail and so on.

My question: Is there a way to change the cell value automatically and send e-mail right after every change? If yes, can you guide me to a resource for me to read and learn?

Thanks a lot :)
 

Johny Doe

New Member
Joined
Jan 18, 2015
Messages
8
Paste it in sheet you wanna work.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Cell As Range
    If Application.Intersect(Target, Range("A1:B30")) Is Nothing Then Exit Sub
    For Each Cell In Target.Cells
        If Len(Cell.Value) = 0 Then
            Application.EnableEvents = False
            Application.Rum "Your_Macro_Name"
            MsgBox "Email Send"
            Application.EnableEvents = True
            Exit For
        End If
    Next Cell
End Sub
 

Forum statistics

Threads
1,085,693
Messages
5,385,220
Members
401,936
Latest member
stephenpoff

Some videos you may like

This Week's Hot Topics

Top