Hi,
I am a beginner to VBA and have started to write a simple weight calculation program, it goes like this:
Private Sub ComboBox1_Change()
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "7.85"
ComboBox1.AddItem "2.60"
ComboBox1.AddItem "8.46"
ComboBox1.AddItem "7.22"
ComboBox1.AddItem "0.85"
ComboBox1.AddItem "1.00"
End Sub
Private Sub CommandButton1_Click()
If TextBox3.Text = "" Then
TextBox4.Text = TextBox1.Text * TextBox2.Text
TextBox5.Text = TextBox4.Text / 1000000
TextBox6.Text = TextBox4.Text * ComboBox1.Text * 0.000001
Else
TextBox4.Text = TextBox1.Text * TextBox3.Text * 6.283185
TextBox5.Text = TextBox4.Text / 1000000
TextBox6.Text = TextBox4.Text * ComboBox1.Text * 0.000001
End If
End Sub
Private Sub CommandButton2_Click()
End
End Sub
The problem I would like to resolve is that my CombBox1 has
6 values that I use for multiplying to find a value in one of my TextBox's
What I would like to do is to name the values in my ComboBox i.e Steel, Aluminium, Bronze, Cast-Iron, Oil, Water but still have them hold the multiplication values.
Is there a way of naming them and still letting them retain the values.
I am a beginner to VBA and have started to write a simple weight calculation program, it goes like this:
Private Sub ComboBox1_Change()
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "7.85"
ComboBox1.AddItem "2.60"
ComboBox1.AddItem "8.46"
ComboBox1.AddItem "7.22"
ComboBox1.AddItem "0.85"
ComboBox1.AddItem "1.00"
End Sub
Private Sub CommandButton1_Click()
If TextBox3.Text = "" Then
TextBox4.Text = TextBox1.Text * TextBox2.Text
TextBox5.Text = TextBox4.Text / 1000000
TextBox6.Text = TextBox4.Text * ComboBox1.Text * 0.000001
Else
TextBox4.Text = TextBox1.Text * TextBox3.Text * 6.283185
TextBox5.Text = TextBox4.Text / 1000000
TextBox6.Text = TextBox4.Text * ComboBox1.Text * 0.000001
End If
End Sub
Private Sub CommandButton2_Click()
End
End Sub
The problem I would like to resolve is that my CombBox1 has
6 values that I use for multiplying to find a value in one of my TextBox's
What I would like to do is to name the values in my ComboBox i.e Steel, Aluminium, Bronze, Cast-Iron, Oil, Water but still have them hold the multiplication values.
Is there a way of naming them and still letting them retain the values.