>[Excel] 庭庭's Question



  1. 下载和打开 VBA 文件

  2. 点击橙色按钮 >>> 完成

  3. 其他: VBA代码

  4.             Sub toRemoveDuplicatesAndDuplicate100Times()
                Application.ScreenUpdating = False
                Dim colE_lasRow As Range
                Dim copyRange As Range
                Dim i As Integer
                
                Columns("E:E").Clear
                Columns("A:A").Copy Range("E1")
                Columns("E:E").RemoveDuplicates Columns:=1, Header:=xlYes
                
               Set colE_lasRow = Cells(Columns("E:E").Rows.Count, 5).End(xlUp).Offset(1, 0)
               Set copyRange = Range(Cells(2, 5), colE_lasRow.Offset(-1, 0))
                
                For i = 1 To 99
                    Set colE_lasRow = Cells(Columns("E:E").Rows.Count, 5).End(xlUp).Offset(1, 0)
                    copyRange.Copy colE_lasRow
                    Set colE_lasRow = Nothing
                Next i
                
                MsgBox "Complete!"
                Application.ScreenUpdating = True
            End Sub
                
              



Source: ---


Disclaimer: The information in this webpage is shared by anonymous users from external online sources. We cannot guarantee its accuracy or truthfulness. Users should exercise caution and verify information independently.


© 2023 maginokarp.com