Está en la página 1de 14

Private Sub ComboBox1_Change()

ComboBox2.Clear

ComboBox3.Clear

If ComboBox1.ListIndex = 0 Then

ComboBox2.AddItem "Metro cúbico", 0

ComboBox2.AddItem "Millón de metros cúbicos", 1

ComboBox2.AddItem "Millón de pies cúbicos", 2

ComboBox2.AddItem "Pie cúbico", 3

ComboBox2.AddItem "Galón", 4

ComboBox2.AddItem "Barriles", 5

ComboBox3.AddItem "Barriles", 0

ComboBox3.AddItem "Pies cúbicos", 1

ComboBox3.AddItem "Litros", 2

ComboBox3.AddItem "Miles de barriles", 3

ComboBox3.AddItem "Metro cúbico", 4

ComboBox3.AddItem "Galones", 5

End If

If ComboBox1.ListIndex = 1 Then

ComboBox2.AddItem "millón de toneladas de petróleo", 0

ComboBox2.AddItem "tonelada de petróleo crudo equivalente", 1

ComboBox2.AddItem "millón de toneladas de petróleo crudo equivalente", 2

ComboBox2.AddItem "tonelada métrica", 3

ComboBox2.AddItem "barril de petróleo", 4

ComboBox2.AddItem "millón de metros cúbicos de gas natural", 5

ComboBox2.AddItem "millón de pies cúbicos de gas natural", 6

ComboBox2.AddItem "metro cúbico de gas natural", 7

ComboBox2.AddItem "metro cúbico de kerosina", 8


ComboBox2.AddItem "metro cúbico de gas de alto horno", 9

ComboBox2.AddItem "metro cúbico de gas de coque", 10

ComboBox2.AddItem "barril de combustóleo pesado", 11

ComboBox2.AddItem "barril de diesel *", 12

ComboBox2.AddItem "tonelada de coque de petróleo", 13

ComboBox2.AddItem "tonelada de bagazo", 14

ComboBox2.AddItem "tonelada de carbón", 15

ComboBox2.AddItem "tonelada de coque de carbón", 16

ComboBox3.AddItem "BTU (1012 unidades térmicas británicas)", 0

ComboBox3.AddItem "Gigajoules (109 joules)", 1

ComboBox3.AddItem "Petajoules (1015 joules)", 2

ComboBox3.AddItem "barriles de petróleo", 3

ComboBox3.AddItem "barril de petróleo", 4

ComboBox3.AddItem "pies cúbicos de gas natural", 5

ComboBox3.AddItem "miles de toneladas de petróleo crudo", 6

ComboBox3.AddItem "Calorías (para efectos de facturación de gas seco)", 7

ComboBox3.AddItem "Calorías (con un factor de corrección calorífica de 1.06)", 8

ComboBox3.AddItem "Kilocalorías", 9

ComboBox3.AddItem "Calorías", 10

End If

If ComboBox1.ListIndex = 2 Then

ComboBox2.AddItem "pie cúbico", 0

ComboBox2.AddItem "BTU", 1

ComboBox2.AddItem "caloría", 2

ComboBox2.AddItem "kilocaloría", 3

ComboBox2.AddItem "petajoule (1 * 1015)", 4

ComboBox2.AddItem "Gigajoule", 5
ComboBox2.AddItem "Petacaloría", 6

ComboBox2.AddItem "Watt hora", 7

ComboBox3.AddItem "MBTU de gas natural", 0

ComboBox3.AddItem "Joules", 1

ComboBox3.AddItem "caloría", 2

ComboBox3.AddItem "BTU", 3

ComboBox3.AddItem "miles de barriles de petróleo crudo equivalente", 4

ComboBox3.AddItem "megawatts", 5

End If

End Sub

Private Sub CommandButton1_Click()

Dim total As Double

If ComboBox1.ListIndex = 0 Then

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 35.31467

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 1

End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 6289.8

End If
If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 178.107

End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 0.0283168

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 0.0238

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 42

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 158.987304

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 35.31467

End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 1

End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 6289.8

End If
If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 178.107

End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 0.0283168

End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 0.0238

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 42

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 158.987304

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 35.31467

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 1

End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 6289.8

End If
If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 178.107

End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 0.0283168

End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 0.0238

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 42

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 158.987304

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 35.31467

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 1

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 6289.8

End If
If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 178.107

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 0.0283168

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 0.0238

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 42

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 158.987304

End If

If ComboBox1.ListIndex = 1 Then

End If
If ComboBox1.ListIndex = 2 Then

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 35.31467

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 1

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 6289.8

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 178.107

End If

If ComboBox2.ListIndex = 0 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 0.0283168

End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 0.0238

End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 42

End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 158.987304


End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 1 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 35.31467

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 1

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 6289.8

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 178.107

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 0.0283168

End If

If ComboBox2.ListIndex = 2 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 0.0238

End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 42

End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 158.987304


End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 35.31467

End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 1

End If

If ComboBox2.ListIndex = 3 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 6289.8

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 178.107

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 0.0283168

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 0.0238

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 42

End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 158.987304


End If

If ComboBox2.ListIndex = 4 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 35.31467

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 1

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 6289.8

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 178.107

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 0.0283168

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 0.0238

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 42

End If

If ComboBox2.ListIndex = 5 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 158.987304


End If

If ComboBox2.ListIndex = 6 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 6 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 35.31467

End If

If ComboBox2.ListIndex = 6 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 1

End If

If ComboBox2.ListIndex = 6 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 6289.8

End If

If ComboBox2.ListIndex = 6 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 178.107

End If

If ComboBox2.ListIndex = 6 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 0.0283168

End If

If ComboBox2.ListIndex = 7 And ComboBox3.ListIndex = 0 Then

total = TextBox1.Value * 0.0238

End If

If ComboBox2.ListIndex = 7 And ComboBox3.ListIndex = 1 Then

total = TextBox1.Value * 42

End If

If ComboBox2.ListIndex = 7 And ComboBox3.ListIndex = 2 Then

total = TextBox1.Value * 158.987304


End If

If ComboBox2.ListIndex = 7 And ComboBox3.ListIndex = 3 Then

total = TextBox1.Value * 6.2898104

End If

If ComboBox2.ListIndex = 7 And ComboBox3.ListIndex = 4 Then

total = TextBox1.Value * 158.987304

End If

If ComboBox2.ListIndex = 7 And ComboBox3.ListIndex = 5 Then

total = TextBox1.Value * 6.2898104

End If

End If

End If

Cells(6, 11).Select

Selection.EntireRow.Insert

Cells(6, 11) = TextBox1.Value

Cells(6, 12) = ComboBox2.Value

Cells(6, 13) = total

Cells(6, 14) = ComboBox3.Value

End Sub
Private Sub UserForm_Initialize()

ComboBox1.AddItem "de Volumen", 0

ComboBox1.AddItem "Caloríficas", 1

ComboBox1.AddItem "Energéticas", 2

End Sub

También podría gustarte