Guest User

Untitled

a guest
Aug 14th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Dim ColNr As Integer
  2. Dim RowNr As Integer
  3. Dim LastLine As String
  4. Dim WS As Worksheet
  5. Dim R As Range
  6.  
  7. For Each WS In ThisWorkbook.Sheets
  8. If WS.Name <> "Sheet1" Then
  9. With WS.UsedRange
  10.  
  11. LastLine = ("PI " & ColNr - 2 & " Achievement")
  12.  
  13. Set R = .Cells.Find(What:=LastLine, LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
  14.  
  15. If Not R Is Nothing Then
  16.  
  17. RowNr = R.Rows
  18.  
  19. End If
  20.  
  21. Sheets("Template").Rows("1:14").Copy
  22. .Cells(RowNr + 2, 1).Paste
  23.  
  24. End With
  25.  
  26. End If
  27.  
  28. Next WS
Add Comment
Please, Sign In to add comment