So, right now I have a functioning code, good or bad one, but what I want to know, is the following:
My code so fare:
Thanks in advance!
- How can split the code up in sections, so I have a better overview? Right now I have one long code, which makes hard to go through.
- How Can i manage the code, so that I begins as soon as i open the workbook.
My code so fare:
Code:
Private Sub ClassBox_Change()
Select Case VersionBox
Case "OIML R51 1996 (Old EU)"
Select Case ClassBox
Case "Y(a)"
ScaleIntervalBox.Clear
Me.ScaleIntervalBox.AddItem "Single"
End Select
Case "OIML R51 2006 (New EU)"
Select Case ClassBox
Case "Y(a)"
ScaleIntervalBox.Clear
Me.ScaleIntervalBox.AddItem "Single"
Me.ScaleIntervalBox.AddItem "Multi"
Case "Y(b)"
ScaleIntervalBox.Clear
Me.ScaleIntervalBox.AddItem "Single"
End Select
Case "NMIA (AU)"
Select Case ClassBox
Case "Y(a)"
ScaleIntervalBox.Clear
Me.ScaleIntervalBox.AddItem "Single"
End Select
Case "NIST (US)"
Select Case ClassBox
Case "Class III"
ScaleIntervalBox.Clear
Me.ScaleIntervalBox.AddItem "Single"
End Select
End Select
End Sub
Private Sub Worksheet_Activate()
Dim Versions As Variant
Dim Typen As Variant
Dim ScaleI As Variant
Dim Unit As Variant
Dim Weight As Variant
Versions = Array("OIML R51 1996 (Old EU)", "OIML R51 2006 (New EU)", "NMIA (AU)", "NIST (US)")
Typen = Array("Post Scale", "Scale")
ScaleI = Array("Single", "Multi")
Unit = Array("g", "kg", "Lb")
Weight = Array(1000, 10000, 15000, 20000, 30000, 35000, 40000, 45000, 50000)
With Me.VersionBox
.Clear
.List = Versions
End With
With Me.TypeBox
.Clear
.List = Typen
End With
With Me.UnitBox
.Clear
.List = Unit
End With
With Me.WeightBox
.Clear
.List = Weight
End With
End Sub
Thanks in advance!