Results 1 to 7 of 7

(2016 issue) Button to add a line from one sheet to a different sheet.

Threaded View

  1. #1
    Registered User
    Join Date
    05-19-2009
    Location
    California
    MS-Off Ver
    Excel 2013-16
    Posts
    55

    (2016 issue) Button to add a line from one sheet to a different sheet.

    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!
    Last edited by justforthis1; 03-15-2016 at 10:32 AM. Reason: Adding more info to the title

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 09-16-2015, 01:18 PM
  2. Copy the data from 1 sheet in vertical line to another sheet in horizontal line
    By Shermaine2010 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2014, 03:46 AM
  3. [SOLVED] VBA - Macro issue copy/paste line other sheet + duplicate current sheet
    By vcourbiere in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-17-2014, 12:06 PM
  4. Replies: 5
    Last Post: 12-12-2013, 02:53 PM
  5. Replies: 0
    Last Post: 03-13-2013, 03:14 PM
  6. Macro to Pull Info from Product Line Sheet to Purchase Order Sheet
    By JeffreyJr in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2012, 11:16 AM
  7. vba button to create line graph in a new sheet
    By zigzag in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-16-2011, 11:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1