View Single Post
 
Old 11-28-2018, 12:33 PM
trevorc trevorc is offline Windows 7 32bit Office 2013
Competent Performer
 
Join Date: Jan 2017
Posts: 173
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default

Here's the code I have so far, but when I run the code I get an error - Code execution has been interrupted. If I then tell the code to continue it works fine.
Any ideas as to why

Code:
Private Sub Add_customer_data()
Dim customer_name
On Error Resume Next
customer_name = ActiveCell.Value
With Sheets("Customer").Range("H4:H5000")
    Set C = .Find(customer_name, LookIn:=xlValues)
    If Not C Is Nothing Then
    t = C.Row
    tt = C.Row
    ttt = ActiveCell.Row
    Sheets("Customer").Range("H" & ttt).Select
    Sheets("Customer").Range("I" & t & ":L" & t).Copy
    Range("I" & ttt).PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
    Sheets("Customer").Range("Y" & t & ":AH" & t).Copy
    Sheets("Customer").Range("Y" & ttt).Select
    Range("Y" & ttt).PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
    Sheets("Customer").Range("H" & ttt).Select
    End If
End With
End Sub
Reply With Quote