Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulate Click Event ben Excel Programming 5 June 9th 05 09:45 PM
How to simulate worksheet rename event Nacho Nachev Excel Programming 4 October 5th 04 03:03 PM
EXCEL 2002: How do I user/simulate a Timer event in Excel form JohnF[_2_] Excel Programming 12 September 23rd 04 04:56 PM
Is there a way to simulate a 'Hide Column' Event? Alan Excel Programming 0 August 31st 04 05:59 AM
EXCEL 2002: How do I user/simulate a Timer event in Excel form John Fejsa Excel Programming 2 August 18th 04 03:44 AM


All times are GMT +1. The time now is 03:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"