![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 34
|
Does anyone know if you can launch a macro based on a cell entry? For instance if a cell is equal to 3 or 9 I want the sheet sent.
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Midlands, UK
Posts: 217
|
Try something like :
Public OldAdd As String Private Sub Worksheet_SelectionChange(ByVal Target As Range) OldAdd = Target.Address End Sub Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Range(OldAdd) = Range("A1") And Range(OldAdd).Value = 3 Or Range(OldAdd).Value = 9 Then Application.Dialogs(xlDialogSendMail).Show End If End Sub You will need to put it in the sheet module ( let me know if you're not sure ). HTH Iain |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|