View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
SHAHID SHAHID is offline
external usenet poster
 
Posts: 12
Default running a macro after updating a cell

again works great..

another follow on question :-)

At present I've got it running with F:F being updated and a date being
inserted into G:G. Could I also have it doing the same thing on the same
sheet for G:G to H:H, I:I to J:J etc..

I tried to copy the code and edit it to give each module uniqueness but that
didn't work...



"Gary''s Student" wrote:

Yes. We change two lines of code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Offset(0, 1).Value = Date
Application.EnableEvents = True
End Sub

--
Gary''s Student - gsnu200749


"Shahid" wrote:

Thanks..that works great..

Another follow on question would be: Could I be done to a whole column...so
that every time you change an entry on each row, it updates the date in the
column besides it.

thanks

"Gary''s Student" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("B1").Value = Date
Application.EnableEvents = True
End Sub

This is worksheet code it goes in the worksheet code area, NOT a standard
module.
--
Gary''s Student - gsnu200749


"Shahid" wrote:

Hello,

Wanted to know if it is possible in Excel to run a macro after updating a
cell..

For example, I wanted excel to "date stamp" cell B1 (using a macro) after
cell A1 has been updated.

Is that possible...thanx