la hice en vba pero ahora la necesitan implementar en libreoffice y ciertamente estoy en lo que es macro en libreoffice me esta constando aprender de golpe.
quisiera si pueden ayudarme a convertir a macro ooobasic y ver si puedo hecharla andar. O darme las pautas que como puedo hacerlo, eso si bien explicado
porque no entiendo muy bien las macro en libreoffice. Se lo agradezco de antemano.
Código: Seleccionar todo
Private Sub CmdAgregar_Click()
Sheets("BasedeDatos").Activate
Range("a2").Select
ActiveCell.FormulaR1C1 = Me.TextBox1.Text
Range("b2").Select
ActiveCell.FormulaR1C1 = Me.TextBox2.Text
Range("c2").Select
ActiveCell.FormulaR1C1 = Me.TextBox4.Text
Range("d2").Select
ActiveCell.FormulaR1C1 = Me.ComboBox6.Text
Range("e2").Select
ActiveCell.FormulaR1C1 = Me.TextBox12.Text
Range("f2").Select
ActiveCell.FormulaR1C1 = Me.TextBox5.Text
Range("g2").Select
ActiveCell.FormulaR1C1 = Me.ComboBox1.Text
Range("h2").Select
ActiveCell.FormulaR1C1 = Me.TextBox6.Text
Range("i2").Select
ActiveCell.FormulaR1C1 = Me.ComboBox2.Text
Range("j2").Select
ActiveCell.FormulaR1C1 = Me.TextBox7.Text
Range("k2").Select
ActiveCell.FormulaR1C1 = Me.ComboBox3.Text
Range("l2").Select
ActiveCell.FormulaR1C1 = Me.TextBox8.Text
Range("m2").Select
ActiveCell.FormulaR1C1 = Me.ComboBox4.Text
Range("n2").Select
ActiveCell.FormulaR1C1 = Me.TextBox9.Text
Range("o2").Select
ActiveCell.FormulaR1C1 = Me.ComboBox5.Text
Range("p2").Select
ActiveCell.FormulaR1C1 = Me.TextBox10.Text
Range("q2").Select
ActiveCell.FormulaR1C1 = Me.TextBox15.Text
'Range("r2").Select
'ActiveCell.FormulaR1C1 = Me.TextBox5.Text
End Sub
Private Sub ComboBox1_Change()
If ComboBox1 = "Si" Then
TextBox6 = 0
Else
If ComboBox1 = "No" Then
TextBox6 = 2
End If
End If
End Sub
Private Sub ComboBox2_Change()
If ComboBox2 = "Todos los días" Then
TextBox7 = 0
Else
If ComboBox2 = "No todo los días" Then
TextBox7 = 1
End If
End If
End Sub
Private Sub ComboBox3_Change()
If ComboBox3 = "Si" Then
TextBox8 = 0
Else
If ComboBox3 = "No" Then
TextBox8 = 2
End If
End If
End Sub
Private Sub ComboBox4_Change()
If ComboBox4 = "Si" Then
TextBox9 = 2
Else
If ComboBox4 = "No" Then
TextBox9 = 0
End If
End If
End Sub
Private Sub ComboBox5_Change()
If ComboBox5 = "No" Then
TextBox10 = 0
Else
If ComboBox5 = "Si, Abuelo/a, Tio/a primo/a en primer grado" Then
TextBox10 = 3
Else
If ComboBox5 = "Si, Padre, Madre, hermano/a, hijos" Then
TextBox10 = 5
End If
End If
End If
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton3_Click()
' Boton Nuevo
Selection.EntireRow.Insert
'Cuadros de textos
Me.TextBox1.Text = Empty
Me.TextBox2.Text = Empty
Me.TextBox3.Text = Empty
Me.TextBox4.Text = Empty
Me.TextBox5.Text = Empty
Me.TextBox6.Text = Empty
Me.TextBox7.Text = Empty
Me.TextBox8.Text = Empty
Me.TextBox9.Text = Empty
Me.TextBox10.Text = Empty
Me.TextBox15.Text = Empty
Me.TextBox12.Text = Empty
Me.TextBox13.Text = Empty
Me.TextBox14.Text = Empty
Me.TextBox16.Text = Empty
'Cuadros combinados
Me.ComboBox1.Text = Empty
Me.ComboBox2.Text = Empty
Me.ComboBox3.Text = Empty
Me.ComboBox4.Text = Empty
Me.ComboBox5.Text = Empty
Me.ComboBox6.Text = Empty
End Sub
Private Sub CommandButton4_Click()
TextBox15.Value = Str$(Round(Val(TextBox2.Value) + Val(TextBox4.Value) + Val(TextBox5.Value) + Val(TextBox6.Value) + Val(TextBox7.Value) + Val(TextBox8.Value) + Val(TextBox9.Value) + Val(TextBox10.Value)))
End Sub
Private Sub CommandButton5_Click()
Sheets("Reporte").Range("b8").Value = TextBox16.Value
Call imprimir
Sheets("Reporte").Range("h11").Value = importe
Sheets("Reporte").Range("e11").Value = ComboBox1.Value
Sheets("Reporte").Range("I3").Value = "000" & TextBox3
Sheets("Reporte").Range("E8").Value = GRADO
Sheets("Reporte").Range("I5").Value = Label3.Caption
Sheets("Reporte").Activate
Unload UserForm1
Load UserForm1
UserForm1.Show
End Sub
Public Sub espacios(seleccion As Selection, lineas As Integer)
Dim i As Integer
For i = 1 To lineas
seleccion.TypeParagraph
Next
End Sub
End Sub
Private Sub TextBox1_Change()
If TextBox1 >= 0 And TextBox1 <= 44 Then
TextBox2 = 0
ElseIf TextBox1 >= 45 And TextBox1 <= 54 Then
TextBox2 = 2
ElseIf TextBox1 >= 55 And TextBox1 <= 64 Then
TextBox2 = 3
ElseIf TextBox1 >= 65 And TextBox1 < 120 Then
TextBox2 = 4
End If
End Sub
Private Sub TextBox12_Change()
If ComboBox6 = "Hombre" Then
If TextBox12 >= 0 And TextBox12 <= 93 Then
TextBox5 = 0
Else
If TextBox12 >= 94 And TextBox12 <= 102 Then
TextBox5 = 3
Else
TextBox5 = 4
End If
End If
Else
If TextBox12 >= 0 And TextBox12 <= 79 Then
TextBox5 = 0
Else
If TextBox12 >= 80 And TextBox12 <= 87 Then
TextBox5 = 3
Else
TextBox5 = 4
End If
End If
End If
End Sub
Private Sub TextBox3_Change()
If TextBox3 > 0 And TextBox3 < 25 Then
TextBox4 = 0
ElseIf TextBox3 <= 26 And TextBox3 <= 30 Then
TextBox4 = 1
ElseIf TextBox3 >= 31 And TextBox3 > 40 Then
TextBox4 = 3
End If
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "Si"
ComboBox1.AddItem "No"
ComboBox1.Value = ""
ComboBox2.AddItem "Todos los días"
ComboBox2.AddItem "No todo los días"
ComboBox2.Value = ""
ComboBox3.AddItem "Si"
ComboBox3.AddItem "No"
ComboBox3.Value = ""
ComboBox4.AddItem "Si"
ComboBox4.AddItem "No"
ComboBox4.Value = ""
ComboBox5.AddItem "No"
ComboBox5.AddItem "Si, Abuelo/a, Tio/a primo/a en primer grado"
ComboBox5.AddItem "Si, Padre, Madre, hermano/a, hijos"
ComboBox5.Value = ""
ComboBox6.AddItem "Hombre"
ComboBox6.AddItem "Mujer"
ComboBox6.Value = ""
End Sub