AndrewMozley
Programmer
Not sure whether I should post this here or on the VBA forum.
My VFP application is creating and populating an Excel sheet; I let the user edit certain fields which I then read back - and use to update a database. I would like to know which rows of the sheet have been edited by the user
There is an event worksheet_change into which I can put some code to set a flag in column 1 when a cell in that row is changed.
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Cells(Target.Row, 1) = -1
Application.EnableEvents = True
End Sub
If I am working in Excel I can code up this procedure. So what I need to know is how (within my VFP code which creates the Excel sheet) can I specify this code which is to be executed when the worksheet_change event fires. I can alter the properties of the Excel object from VFP but I do not know how to subclass its methods.
My VFP application is creating and populating an Excel sheet; I let the user edit certain fields which I then read back - and use to update a database. I would like to know which rows of the sheet have been edited by the user
There is an event worksheet_change into which I can put some code to set a flag in column 1 when a cell in that row is changed.
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Cells(Target.Row, 1) = -1
Application.EnableEvents = True
End Sub
If I am working in Excel I can code up this procedure. So what I need to know is how (within my VFP code which creates the Excel sheet) can I specify this code which is to be executed when the worksheet_change event fires. I can alter the properties of the Excel object from VFP but I do not know how to subclass its methods.