+ Reply to Thread
Results 1 to 4 of 4

Run time error 1004 for macro

Hybrid View

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    5

    Run time error 1004 for macro

    I am receiving an error for a macro within the attached spreadsheet that is supposed to move completed rows from the 'manual data' tab to the 'completed' tab. I am unsure how to fix the Run-time error 1004, so I am posting here for help. The rows are being moved to the 'completed' tab; however, they are not being deleted from the 'manual data' tab as expected. Please let me know if you need any additional info. Thanks Copy of Excel Testing___10-9-12 maintenance2.zip
    Last edited by gregoryspeters; 12-02-2012 at 04:12 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Run time error 1004 for macro

    Hi gregoryspeters

    Perhaps this
    Option Explicit
    
    Sub TransferToCompleted()
    
        Dim LR As Long
        Dim TA As Long
        Dim Ronos As String
    
        LR = Sheets("manual data").Range("$A$1").CurrentRegion.Rows.Count
    
    
        Sheets("manual data").Range("$A$1").CurrentRegion.AutoFilter Field:=25, Criteria1:="Yes"
    
        With Sheets("completed")
            If .Range("A2") = "" Then
                Range("A2:Y" & LR).Copy .Range("A2")
            Else
                Range("A2:Y" & LR).Copy .Range("A2").End(xlDown).Offset(1, 0)
            End If
        End With
    
        With Sheets("manual data")
            .UsedRange.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
            .AutoFilterMode = False
        End With
    End Sub
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    07-30-2012
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Run time error 1004 for macro

    Works great... thanks for your help!

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Run time error 1004 for macro

    You're welcome...glad I could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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