+ Reply to Thread
Results 1 to 20 of 20

Macro runs Slowly

Hybrid View

  1. #1
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Macro runs Slowly

    Hi

    I've just tweaked dangelor's code a bit and I think it gives you what you are chasing.

    Sub InsertRowS2()
        
        With Worksheets("Data Input -Unit Leaders")
            .Activate
            .Unprotect Password:="team"
            .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0).EntireRow.Copy
            .Cells(.Rows.Count, 1).End(xlUp).Offset(-1, 0).EntireRow.Resize(250).Insert shift:=xlDown
            .Protect Password:="team"
        End With
        
        With Worksheets("Ranking  - Unit Leaders")
            .Activate
            .Unprotect Password:="team"
            .Cells(.Rows.Count, 1).End(xlUp).Offset(-2, 0).EntireRow.Copy
            .Cells(.Rows.Count, 1).End(xlUp).Offset(-1, 0).EntireRow.Resize(250).Insert shift:=xlDown
            .Protect Password:="team"
        End With
    
    End Sub
    rylo

  2. #2
    Forum Contributor
    Join Date
    01-03-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2016,Excel 2013
    Posts
    186

    Re: Macro runs Slowly

    Hi Rylo

    Thanks for the code. Is is certainly faster. Just one hurdle to cross. The Data Input - Sheet is fully protected but permits
    data entry only in specific range. The new rows which are created are locked. My earlier macro did have not this issue.
    Maybe when the formula copies, it should copy the formats as well and this could help,
    Can you tweak the code?

    Thanks

+ 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