Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Private Sub CommandButton5_Click()
  2.  
  3. projname = Range("E17")
  4. projnum = Range("E19")
  5.  
  6. Dim obook As Workbook
  7.  
  8. Set obook = Workbooks(Replace(projname, " ", "") + ".xlsx")
  9.  
  10. obook.Activate
  11.  
  12. ActiveSheet.Range("A99") = 6
  13.  
  14. counter = ActiveSheet.Range("A99").Value
  15.  
  16. If counter Mod 2 <> 0 Then
  17. With ActiveSheet.Range(Cells(globalcounter, 1), Cells(globalcounter, 8)).Interior
  18. .Pattern = xlSolid
  19. .PatternColorIndex = xlAutomatic
  20. .ThemeColor = xlThemeColorAccent5
  21. .TintAndShade = 0.599993896298105
  22. .PatternTintAndShade = 0
  23. End With
  24.  
  25. Else
  26. With ActiveSheet.Range(Cells(globalcounter, 1), Cells(globalcounter, 8)).Interior
  27. .Pattern = xlSolid
  28. .PatternColorIndex = xlAutomatic
  29. .ThemeColor = xlThemeColorAccent5
  30. .TintAndShade = 0.799981688894314
  31. .PatternTintAndShade = 0
  32. End With
  33. End If
  34.  
  35. counter = counter + 1
  36.  
  37. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement