![]() |
|
#4
|
|||
|
|||
|
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
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Copy two separate ranges from another workbook
|
kevinbradley57 | Excel Programming | 11 | 07-25-2018 01:51 PM |
| Looking to copy select cells in table using dropdown list to paste to new table in another worksheet | CaptainRetired | Excel Programming | 18 | 01-04-2018 07:22 PM |
Copy/Paste EXCEL cells as pic in WORD
|
A_Lau | Drawing and Graphics | 3 | 12-19-2014 06:57 AM |
| Can you copy & paste cells across worksheets and preserve reference to worksheet? | New Daddy | Excel | 2 | 11-27-2013 07:19 AM |
Paste Special: Copy and Paste Formatting Only?
|
tinfanide | Word | 6 | 03-06-2013 12:21 AM |