I dont get this to work can someone tell me what need to change for it to work....I have a macro CopyHis thats called only if cells B2-G2 is triggered(changed) by a copy paste. If I manually go change 1 digit it runs through but a copy and paste dont trigger it.....Rep given fo a solution that help it to trigger a change due to copy and paste
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.CountLarge > 1 Then Exit Sub
If Target.Value = vbNullString Then Exit Sub
If Not Intersect(Range("B2:G2"), Target) Is Nothing Then
CopyHis ' Macro thats been called on a change on B2-G2 due to copy and paste
Application.EnableEvents = True
End If
End Sub
Sub CopyHis()
'
' CopyHis Macro
'
Dim wb As Workbook
Set wb = Application.Workbooks(Figures.xlsm")
wb.Activate
'wb.Sheets("Sheet1").Range("A1").Select 'No error.
Sheets("HistoryD").Select
ActiveSheet.Unprotect Password:="sd2299"
Columns("A:G").Select
Selection.Copy
Sheets("HistoryDD").Select
Sheets("HistoryDD").Range("A1").PasteSpecial Paste:=xlPasteValues
wb.Sheets("HistoryDD").Rows("2:2").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
wb.Sheets("Skips").Select
wb.Sheets("Skips").Range("F5:J5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("HistoryD").Select
Range("J2").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
End Sub
Bookmarks