+ Reply to Thread
Results 1 to 20 of 20

Macro runs Slowly

Hybrid View

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

    Re: Macro runs Slowly

    Hi Dangelor,

    I used the above code but it groups the newly inserted rows since the row where it copies the formula is grouped.
    This cannot be ungrouped by the user as the worksheet is protected.
    Please refer to the original file I have attached and the macro does not group the new insertion .

    Appreciate if you can tweak it.

    Thanks

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,308

    Re: Macro runs Slowly

    Tweaked...
    Sub InsertRowS4()
    
        With Worksheets("Data Input -Unit Leaders")
            .Activate
            .Unprotect Password:="team"
            With .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0).EntireRow
                .Cells.Locked = False
                .Ungroup
                .Copy
                .Group
            End With
            .Cells(.Rows.Count, 1).End(xlUp).Offset(-1, 0).EntireRow.Resize(250).Insert
            .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

+ 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