View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Barlow Tim Barlow is offline
external usenet poster
 
Posts: 34
Default Trigger copy on AfterUpdate event

Try this placed on the sheet's module:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim previousRow As Long

previousRow = Target.Row - 1
If previousRow = 1 Then
If UCase(Cells(previousRow, "D")) = "NO" Then
Worksheets("Sheet2").Cells(previousRow, "A") =
Cells(previousRow, "B")
End If
End If
End Sub

HTH

Tim


"Snowsride" wrote in message
...
I have a spreadsheet with data in columns A - J. Column D contains a

listbox
with a Yes/No selection.

If a cell in column D value is 'No' I want to copy the data from cell A of
the same row to Sheet 2 column B. As the user moves down the data then

each
selection from the corresponding cell in column D should trigger the event
and the data in A of that row should be copied to Sheet 2 column B.

Help appreciated.