Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to make a macro run the moment a cell has been entere
into? I know it can be done so the macro runs when you open and close a fil but can it be done for after a cell has been changed? If so whats the code -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check out this site about events
http://www.cpearson.com/excel/events.htm You can use the change event in a Sheet module Right click on a sheet tab and choose view code Paste the code there Alt-Q to go back to Excel If A1 change the macro "YourMacroName" will run Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Range("A1"), Target) Is Nothing Then YourMacroName End If End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "ianripping " wrote in message ... Is it possible to make a macro run the moment a cell has been entered into? I know it can be done so the macro runs when you open and close a file but can it be done for after a cell has been changed? If so whats the code? --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I do apologize. I meant to put this in the code for the workbook:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target A Range) If Target.Column = 1 And Target.Row = 1 Then MsgBox ("HI!") End If End Sub - Piku -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Double-click the sheet you're using in your VBAProject to open the cod
window. Paste this in it: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target = Range("A1") Then End If End Sub The code in the If Statement will only run if the particular Range yo name was the "Target" of the change in the worksheet. - Piku -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatic Formula or Macro | Excel Worksheet Functions | |||
Automatic run of Macro | Excel Discussion (Misc queries) | |||
Automatic run of Macro | Excel Discussion (Misc queries) | |||
Use IF function to automatic run macro | Excel Worksheet Functions | |||
automatic macro execution | Excel Programming |