Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there a cell update event? 1

Status
Not open for further replies.

Davefeet

Technical User
Jan 24, 2002
212
US
I have an excel workbook, each row is a record, I want column A to be updated with the current date whenever anybody changes anything or adds antything into any other cell in that same row.


Any suggestions

SLC: Greatest snow on earth!!!
 
right click on sheet tab and View Code

paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
MyRow = Target.Row
Cells(MyRow, 1).Value = Now()

End Sub

should work fine

Jamie Gillespie
j-gillespie@s-cheshire.ac.uk
 
That isn't working, am I missing something here.
I see what you are doin but doesnt seem to work.

any other suggestions

SLC: Greatest snow on earth!!!
 
any errors? are you moving off cell once edited?

works for me

Jamie Gillespie
j-gillespie@s-cheshire.ac.uk
 
yes I am moving off cell
and no errors



SLC: Greatest snow on earth!!!
 
yep

I have other macros that work

Is it working in your workbook

SLC: Greatest snow on earth!!!
 
Have you pasted it into the WORKSHEET module or a standard module

ie did you right click on the sheet tab and choose "View Code" or did you go to the VBE and insert a module (or add it to an existing module)



Rgds, Geoff
[blue]Experience is something you don't get until just after you need it[/blue]
We want to help [red]you[/red] Help us by reading this FAQ 1st faq222-2244
 
Got it to work, this is all in the worksheet.


Sub Worksheet_Change(ByVal Target As Range)
Myrow
End Sub


Public Sub Myrow()
Dim Myrow As Integer
Myrow = Selection.Row
Cells(Myrow, 1).Value = Now()
End Sub


SLC: Greatest snow on earth!!!
 
Another thing to try - run this from a standard module

sub Enabler()
application.enableevents = true
end sub

Rgds, Geoff
[blue]Experience is something you don't get until just after you need it[/blue]
We want to help [red]you[/red] Help us by reading this FAQ 1st faq222-2244
 
That is wierd I tried what you suggested and now it works, the difference is I dimensioned MyRow
Thanks for all your help

Sub Worksheet_Change(ByVal Target As Range)
Dim Myrow As Integer
Myrow = Target.Row
Cells(Myrow, 1).Value = Now()
End Sub


SLC: Greatest snow on earth!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top