¿Cómo puedo migrar un codigo de Microsoft Excel VBA al codigo de OpenOffice VB? ¿Hay mucha diferencia entre ambos códgos?
Ejemplo de mi código:
Código: Seleccionar todo
Sub Módulo2
Sub Esconde_filas()
'
' Esconder todas las filas que sean domingo
If MsgBox("¿Desea eliminar los DOMINGOS?", vbYesNo + vbCritical, "Atención") = 6 Then
Dim x As Integer
For x = 11 To 41
Range("C" & x).Select
Selection.NumberFormat = "[$-F800]dddd, mmmm dd, yyyy"
If (Range("L" & x).Value > 6) Then
Range("L" & x).Select
Selection.EntireRow.Hidden = True
Else
Range("L" & x).Select
Selection.EntireRow.Hidden = False
End If
Next x
Range("C11").Select
MsgBox "Listo"
End If
End Sub
Public Sub Reset()
'
' Resetear valores y volver a mostrar todos los días
If MsgBox("¿Seguro que desea restablecer las celdas?", vbYesNo + vbQuestion, "Advertencia") = 6 Then
Dim fila, col, x, z As Integer
Busca_Encargado
'For z = 3 To 9
' Range("C" & z) = ""
'Next z
For x = 11 To 41
Range("C" & x).Select
Selection.NumberFormat = "[$-F800]dddd, mmmm dd, yyyy"
Range("L" & x).Select
Selection.EntireRow.Hidden = False
Range("D" & x) = ""
Range("E" & x) = ""
Range("H" & x) = ""
If Range("L" & x).Value = 8 Then
Selection.EntireRow.Hidden = True
End If
Next x
Range("C11").Select
'Buscar el plan
Range("I43").Value = ""
For fila = 11 To 27
If Range("AC" & fila).Value = Range("C4").Value Then
For col = 30 To 41
If Cells(10, col) = Range("C8").Value Then
Range("I43").Value = Cells(fila, col).Value
End If
Next col
End If
Next fila
Range("D46").Value = ""
Range("C11").Select
MsgBox "Listo"
End If
End Sub
Public Function Busca_Encargado()
'Buscar Encargado de tienda
Dim c As Integer
For c = 11 To 26
If Range("C4").Value = Range("P" & c).Value Then
Range("C6").Value = Range("Q" & c).Value 'Asigna el nombre del encargado'
Range("B1").Value = Range("O" & c).Value 'Asigna el numero de la columna de la tienda'
End If
Next c
End Function
Public Sub Plan_diario()
'Asignar el Plan del día por grupo - Curiosa!'
Dim col, fil, x, y As Integer
col = Range("B1").Value
For fil = 11 To 42
For x = 11 To 375
If Cells(fil, 3) = Cells(x, 46) Then
Cells(fil, 4) = Cells(x, col) * Range("I43").Value
End If
Next x
Next fil
End Sub
End Sub