Guest User

Untitled

a guest
Apr 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Sub buttonsAdd()
  2. Dim btn As Button
  3. LastRow = wsAuth.Cells(wsAuth.Rows.count, "A").End(xlUp).row
  4. Application.ScreenUpdating = False
  5. wsAuth.Buttons.Delete
  6. Dim t As Range
  7. For i = 1 To LastRow
  8. Set t = wsAuth.Range(wsAuth.Cells(i, 6), wsAuth.Cells(i, 6))
  9. Set btn = wsAuth.Buttons.add(t.Left, t.Top, t.Width, t.Height)
  10. With btn
  11. .OnAction = "btnS"
  12. .Caption = SignInButCaption & wsAuth.Cells(i, 1).Value
  13. .Name = "Btn" & i
  14. .HorizontalAlignment = xlLeft
  15. .VerticalAlignment = xlCenter
  16. .AutoSize = False
  17. End With
  18. Next i
  19. Application.ScreenUpdating = True
  20. End Sub
Add Comment
Please, Sign In to add comment