Capturing Copy/Paste Changes in Change Worksheet

sscornav

Board Regular
Joined
Mar 20, 2010
Messages
125
I have the following worksheet in Excel 2003
Excel Workbook
ABCDEFG
11Q2Q3Q4QTotalDate ChangedUser Name
214.0010.0022.0046.00
315.0015.0035.0065.00
475.0075.0035.00185.00
545.0045.0088.00178.00
Sheet1


I have a macro (provided by Hiker95) which will populate the date/user whenever the user modifies the yellow fields.


Private Sub Worksheet_Change(ByVal Target As Range)' hiker95, 05/24/2011' http://www.mrexcel.com/forum/showthread.php?t=552211If Intersect(Target, Range("A2:D5")) Is Nothing Then Exit SubIf Target.Count > 1 Then Exit SubWith Application .EnableEvents = False .ScreenUpdating = False Range("F" & Target.Row) = Format(Now, "mm/dd/yyyy hh:mm:ss AM/PM") Range("G" & Target.Row) = Environ("username") .EnableEvents = True .ScreenUpdating = TrueEnd WithEnd Sub</PRE>
However, if the user pastes the values in as opposed to typing them in, we don't capture the update.

Can anyone assist with the additional code? Thanks!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
' hiker95, 05/24/2011' http://www.mrexcel.com/forum/showthread.php?t=552211
Dim c As Range
If Intersect(Target, Range("A2:D5")) Is Nothing Then Exit Sub
With Application
    .EnableEvents = False
    .ScreenUpdating = False
    For Each c In Target
        Range("F" & c.Row) = Format(Now, "mm/dd/yyyy hh:mm:ss AM/PM")
        Range("G" & c.Row) = Environ("username")
    Next c
    .EnableEvents = True
    .ScreenUpdating = True
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top