Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem Editing Macro in Shared Excel File | Excel Discussion (Misc queries) | |||
double click a xls file and start Excel but without the file | Excel Discussion (Misc queries) | |||
Macro in Excel 2002 to save a workbook to a FTP location | Excel Discussion (Misc queries) | |||
How can I get a macro in Excel to set the Zoom to "Selection"? | Excel Discussion (Misc queries) | |||
Turning a Macro into an add-in for Excel? | Excel Worksheet Functions |