Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simulate Access' After Update Event
Is there a way to simulate Access' After Update event in an Excel
spreadsheet? For example, if I had a column and someone entered a value into it, can I write a routine to check the data and run other macros? I realize that's not very clear and I know Excel has validation boxes, but let's say I have a sheet that I want people to put an ID in the first column of, the routine should check that the ID hasn't been previously used and should populate the name, address... fields. I'm not asking for anything that perfect to exist, but if someone could either copy me a code chunk or point me to a good example online I would really appreciate it. TIA Mark |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simulate Access' After Update Event
This sounds like you you want the worksheet change event. An outline example
Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "H1:H10" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target 'do your stuff End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "MChrist" wrote in message ... Is there a way to simulate Access' After Update event in an Excel spreadsheet? For example, if I had a column and someone entered a value into it, can I write a routine to check the data and run other macros? I realize that's not very clear and I know Excel has validation boxes, but let's say I have a sheet that I want people to put an ID in the first column of, the routine should check that the ID hasn't been previously used and should populate the name, address... fields. I'm not asking for anything that perfect to exist, but if someone could either copy me a code chunk or point me to a good example online I would really appreciate it. TIA Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Simulate Click Event | Excel Programming | |||
How to simulate worksheet rename event | Excel Programming | |||
EXCEL 2002: How do I user/simulate a Timer event in Excel form | Excel Programming | |||
Is there a way to simulate a 'Hide Column' Event? | Excel Programming | |||
EXCEL 2002: How do I user/simulate a Timer event in Excel form | Excel Programming |