Hay que agregar estas líneas para separar los meses:
'llena combo1 y 2
meses = Split(ComboBox6.Value, "-")
ComboBox1.Value = WorksheetFunction.Trim(meses(0))
ComboBox2.Value = WorksheetFunction.Trim(meses(1))
El evento completo:
'
Private Sub ComboBox6_Change()
'Por. Dante Amor
'
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox11 = ""
If ComboBox6.Value = "" Or ComboBox6.ListIndex = -1 Then Exit Sub
'
'Busca saldos
Set b = h1.Rows("10:19").Find(ComboBox6.Value, lookat:=xlWhole)
If Not b Is Nothing Then
TextBox5 = b.Offset(1, 0)
TextBox6 = b.Offset(2, 0)
TextBox7 = b.Offset(3, 0)
TextBox8 = b.Offset(4, 0)
TextBox9 = b.Offset(5, 0)
TextBox10 = b.Offset(6, 0)
TextBox11 = b.Offset(7, 0)
End If
'
'busca total
Set b = h1.Range("F2:F7").Find(ComboBox6.Value, lookat:=xlWhole)
If Not b Is Nothing Then
TextBox1 = b.Offset(0, 1)
End If
'
'Porcentajes
TextBox2 = h2.Range("H33")
TextBox3 = h2.Range("H34")
TextBox4 = h2.Range("H35")
If TextBox1.Value = "" Then t1 = 0 Else t1 = CDbl(TextBox1.Value)
If TextBox5.Value = "" Then t5 = 0 Else t5 = CDbl(TextBox5.Value)
If TextBox6.Value = "" Then t6 = 0 Else t6 = CDbl(TextBox6.Value)
If TextBox7.Value = "" Then t7 = 0 Else t7 = CDbl(TextBox7.Value)
If TextBox8.Value = "" Then t8 = 0 Else t8 = CDbl(TextBox8.Value)
If TextBox9.Value = "" Then t9 = 0 Else t9 = CDbl(TextBox9.Value)
If TextBox10.Value = "" Then t10 = 0 Else t10 = CDbl(TextBox10.Value)
If TextBox11.Value = "" Then t11 = 0 Else t11 = CDbl(TextBox11.Value)
If TextBox17.Value = "" Then t17 = 0 Else t17 = CDbl(TextBox17.Value)
h2.Range("H17") = t1 'utilidad bruta
h2.Range("F63") = t5 'aseo y limpieza
h2.Range("F64") = t6 'eventos culturales
h2.Range("F65") = t7 'eventos deportivo
h2.Range("F66") = t8 'reunion academicas
h2.Range("F68") = t9 'mantenimiento
h2.Range("F69") = t10 'art de oficina
h2.Range("F70") = t11 'otras actividades
h2.Range("F79") = t17 'otras actividades 30%
'
'llena combo1 y 2
meses = Split(ComboBox6.Value, "-")
ComboBox1.Value = WorksheetFunction.Trim(meses(0))
ComboBox2.Value = WorksheetFunction.Trim(meses(1))
End Sub
.
.