Last active
December 2, 2018 15:07
-
-
Save lan2720/e50bff4a249773d01ea8675cd216516d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub 粘贴时跳过隐藏行() | |
startRow = 2 | |
endRow = 1603 | |
startCol = 4 | |
endCol = 5 | |
srcStartCol = 1 | |
Dim Rng As Range | |
Dim i As Integer | |
For x = startCol To endCol | |
i = 0 | |
Set Rng = Range(Cells(startRow, x), Cells(endRow, x)).SpecialCells(xlCellTypeVisible) | |
For Each cell In Rng | |
Worksheets("Sheet2").Cells(i + 1, srcStartCol).Copy | |
ActiveSheet.Paste Destination:=cell | |
Application.CutCopyMode = False | |
i = i + 1 | |
Next | |
srcStartCol = srcStartCol + 1 | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment