Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Trigger copy on AfterUpdate event

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PivotField AfterUpdate event? Snowsride Excel Programming 0 January 11th 06 01:12 PM
Event Trigger lobo Excel Programming 5 December 16th 05 08:33 PM
AfterUpdate Event not Running Craig[_21_] Excel Programming 10 November 6th 05 10:28 PM
trigger an EVENT when the value in a cell changes? Controls Freak Excel Programming 1 December 21st 04 07:24 AM
Trigger Event Todd Huttenstine Excel Programming 2 July 14th 04 06:50 PM


All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"