Tyberian1988
New member
- Joined
- Mar 5, 2014
- Messages
- 3
- Reaction score
- 0
- Points
- 0
I need the spin button down to do the same with the spin button up.To increment by 1 not all the columns.
Code:
Option Explicit
Dim i As Integer, j As Integer
Private Sub SpinButton1_SpinDown()
Sheet1.Unprotect Password:="dominique"
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
i = 28
Columns("Ac:Ag").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
With Selection.Interior
.Pattern = xlNone
.PatternColorIndex = xlNone
End With
Range("ac2:ag61").ClearContents
Range("b2:b61").ClearContents
Range("a3:a61").ClearContents
j = 2
Range("Al3:Aq7").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
With Selection.Interior
.Pattern = xlNone
.PatternColorIndex = xlNone
End With
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Sheet1.Protect Password:="dominique"
End Sub
Private Sub SpinButton1_SpinUp()
Sheet1.Unprotect Password:="dominique"
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
If i = 33 Then Exit Sub
i = i + 1
If j = 11 Then Exit Sub
j = j + 1
With ActiveSheet
.Range("ab1:ab61").Copy
.Cells(1, i).PasteSpecial Paste:=xlPasteFormats
.Range("Al2:Aq2").Copy
.Cells(j, 38).PasteSpecial Paste:=xlPasteFormats
End With
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Sheet1.Protect Password:="dominique"
End Sub