ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Help? start macro automatic in excel (https://www.excelbanter.com/excel-worksheet-functions/21008-help-start-macro-automatic-excel.html)

pim_parra

Help? start macro automatic in excel
 

Hi,
Who has some code for the following problem:

supose a value in cell a1 and an other in cell b1
i want to start a macro automatical
when for example value a1 b1
in other words how tot start of a macro when a
certain condition is true
thanks


--
pim_parra
------------------------------------------------------------------------
pim_parra's Profile: http://www.msusenet.com/member.php?userid=418
View this thread: http://www.msusenet.com/t-1869401224


Otto Moehrbach

One way:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column 2 Then Exit Sub
If Cells(Target.Row, 1) Cells(Target.Row, 2) Then
'Put what you want to do here
End If
End Sub

This macro is triggered to execute whenever the contents of any cell on the
entire sheet is changed. The code in the macro specifically says to do
nothing if the changed cell is not in either column A or Column B. If the
content of Column A is greater than that of Column B in the row of the
changed cell, the code will execute the code you place in the space labeled
" 'Put what you want to do here".
This macro must be placed in the sheet module of the sheet that holds the
data you want it to operate on. Right-click on the sheet tab, select View
Code, and paste this macro in the displayed module. HTH Otto
"pim_parra" wrote in message
...

Hi,
Who has some code for the following problem:

supose a value in cell a1 and an other in cell b1
i want to start a macro automatical
when for example value a1 b1
in other words how tot start of a macro when a
certain condition is true
thanks


--
pim_parra
------------------------------------------------------------------------
pim_parra's Profile: http://www.msusenet.com/member.php?userid=418
View this thread: http://www.msusenet.com/t-1869401224




pim_parra


Thanks Otto,

I made some modification as folows
i now compare the values in 2 colums
when the first value=1 and the other = 2 the email is sent
that works fine, thanks
There is only one problem it works fine as long as
the colums contain value's
how to do it when ther are formulas in both colums

s.y.
Do


--
pim_parra
------------------------------------------------------------------------
pim_parra's Profile: http://www.msusenet.com/member.php?userid=418
View this thread: http://www.msusenet.com/t-1869401224



All times are GMT +1. The time now is 11:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com