Please ignore as now closed.
Hi all,
I am recording mutliple macros and am looking at using spin box. Basically, I have done it that when I click on 'spin down' once it should add a tenderer and if I click on 'spin up' it adds a tenderer (done this by copying the recorded macros). What I want it to do is if I click on 'spin down' another time it adds another tenderer (I want to do this a maximum of two times), I just don't know how to split the code. Would a list be easier? Whereby I can select the number of tenderers (1,2,3,4,etc) and based on the number chosen it will add that number of tenderers, if that makes sense? It's only copying a few cells, then when I am recording, I can make sure the formulas are correct.
The code for the spin box is below (trying to split macro 1 and 3 and 2 and 4, then any others that I add):
Private Sub SpinButton21_SpinDown()
' Macro1 Macro
'
'
Range("B29:D34").Select
Selection.Copy
Range("F29").Select
ActiveSheet.Paste
' Macro3 Macro
'
'
Range("B22:D27").Select
Application.CutCopyMode = False
Selection.Copy
Range("J29").Select
ActiveSheet.Paste
Range("J29:L29").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Tenderer 6"
Range("N28").Select
End Sub
Private Sub SpinButton21_SpinUp()
' Macro2 Macro
'
'
Application.CutCopyMode = False
Range("F29:H34").Select
Selection.Clear
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("J30").Select
' Macro4 Macro
'
'
Range("J29:L34").Select
Selection.Clear
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("D19").Select
End Sub
Bookmarks