Hi all,
I am having a hard time debugging this because it runs fine on my computer, using Excel 2013.
It currently doesn't run on two of my co-workers computers who are running Excel 2016.
It did work previously, then a couple of weeks ago it just stopped working.
Dim source_row As Integer
Dim destination_row As Integer
Application.ScreenUpdating = False
'quick and dirty copy paste from parts catalog to quote template
If ActiveSheet.Name = "Parts Catalog" Then
source_row = ActiveCell.Row
destination_row = 17
'check to see if the first row (17) is empty, if so then put in the data
If Sheets("Quote Template").Range("F" & destination_row).Value = "" Then
With Sheets("Quote Template")
.Range("E" & destination_row).Value = Sheets("Parts Catalog").Range("E" & source_row).Value
.Range("F" & destination_row).Value = Sheets("Parts Catalog").Range("F" & source_row).Value
.Range("K" & destination_row).Value = Sheets("Parts Catalog").Range("K" & source_row).Value
.Range("L" & destination_row).Value = Sheets("Parts Catalog").Range("L" & source_row).Value
.Range("N" & destination_row).Value = Sheets("Parts Catalog").Range("N" & source_row).Value
End With
'check to see if row (17) is empty, if it is not empty then move down a row until it is empty
ElseIf Sheets("Quote Template").Range("F" & destination_row).Value <> "" Then
'loop to find the next empty row
Do Until IsEmpty(Sheets("Quote Template").Range("F" & destination_row).Value)
destination_row = destination_row + 1
Loop
With Sheets("Quote Template")
.Rows(destination_row).Copy
.Rows(destination_row).Insert Shift:=xlDown
.Range("E" & destination_row).Value = Sheets("Parts Catalog").Range("E" & source_row).Value
.Range("F" & destination_row).Value = Sheets("Parts Catalog").Range("F" & source_row).Value
.Range("K" & destination_row).Value = Sheets("Parts Catalog").Range("K" & source_row).Value
.Range("L" & destination_row).Value = Sheets("Parts Catalog").Range("L" & source_row).Value
.Range("N" & destination_row).Value = Sheets("Parts Catalog").Range("N" & source_row).Value
End With
End If
Sheets("Parts Catalog").Select
End If
Application.CutCopyMode = False
Application.ScreenUpdating = True
The usual error is:
Run-time error '-21474`7848 (80010108)':
Method 'Select' of object '_Worksheet' failed
I appreciate the help!
Bookmarks