Guest User

Untitled

a guest
Dec 13th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. Sub Add_Row()
  2.  
  3. Application.ScreenUpdating = False
  4.  
  5. ActiveSheet.Unprotect
  6. With ActiveWorkbook.ActiveSheet
  7. If .FilterMode Then
  8. .ShowAllData
  9. End If
  10. End With
  11.  
  12. Sheets("People to Project").Select
  13. ActiveSheet.Unprotect
  14. With ActiveWorkbook.ActiveSheet
  15. If .FilterMode Then
  16. .ShowAllData
  17. End If
  18. End With
  19.  
  20. r0w = ActiveCell.Row
  21. c0l = ActiveCell.Column
  22.  
  23. ThisWorkbook.Sheets("Overview").Cells(r0w, c0l).EntireRow.Insert
  24. ThisWorkbook.Sheets("People to Project").Cells(r0w, c0l).EntireRow.Insert
  25.  
  26. Sheets("Overview").Select
  27. Range(Cells(r0w, 17), Cells(r0w, 48)).Select
  28. Selection.Style = "1. Projectfield"
  29.  
  30. Sheets("People to Project").Select
  31.  
  32. ActiveSheet.Unprotect
  33.  
  34. Range(Cells(r0w, 12), Cells(r0w, 43)).Select
  35. Selection.Style = "1. Projectfield"
  36.  
  37. ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
  38. False, AllowFormattingCells:=True, AllowFiltering:=True
  39.  
  40. Sheets("Overview").Select
  41. ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
  42. False, AllowFormattingCells:=True, AllowFiltering:=True
  43.  
  44. Application.ScreenUpdating = True
  45.  
  46. End Sub
Add Comment
Please, Sign In to add comment