View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default use vb to determine last cell changed

Hi,

Right click your sheet tab, view code and paste this in.

the messagebox bit isn't necessary, it's to demonstrate the method

Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox "Last changed cell was " & Target.Address
Application.EnableEvents = False
Cells(Target.Row, 2).Value = "Something"
Application.EnableEvents = True
End Sub

Mike

" wrote:

Is it possible for VB to determine the last cell that was changed. I'm
not referring to a cell changed by a macro, just a cell that was
changed by typing into the cell. I want a macro to then update a cell
in the same row, column B.

Thanks