Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Trigger copy on AfterUpdate event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Snowsride - 22 Feb 2006 16:32 GMT
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.
Tim Barlow - 23 Feb 2006 20:50 GMT
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

> I have a spreadsheet with data in columns A - J.  Column D contains a listbox
> with a Yes/No selection.
[quoted text clipped - 5 lines]
>
> Help appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.