Antes que nada me presento, soy bender de Uruguay.
Estuve buscando un monton de manuales para aprender la
sintaxis de starbasic, pero no tuve suerte en cuanto a lo que se refiere a que me funcionen las cosas
que hice
Espero puedan ayudarme. Salu2
Muchas gracias
Sub verinfo()
Columns("D:H").Select
Selection.EntireColumn.Hidden = False
Range("A10").Select
End Sub
Sub ocultarinfo()
Sub vertrim2()
Columns("O:T").Select
Selection.EntireColumn.Hidden = False
ActiveWindow.SmallScroll Down:=-6
Range("O12").Select
End Sub
Sub ocultartrim2()
Sub OCULTARCANJE()
Columns("D:AI").Select
Range("AI1").Activate
Selection.EntireColumn.Hidden = True
Columns("A:C").Select
Range("C1").Activate
Selection.EntireColumn.Hidden = False
Rows("1:3569").Select
Range("A3569").Activate
Selection.EntireRow.Hidden = False
Range("A3474").Select
Selection.End(xlUp).Select
Selection.End(xlUp).Select
Selection.End(xlUp).Select
Range("A11").Select
End Sub
Pasar unas macros de excel a calc
Pasar unas macros de excel a calc
Última edición por madbender el Vie Sep 25, 2009 7:34 pm, editado 2 veces en total.
OpenOffice 3.0 windows xp
Re: Pasar unas macros de excel a calc, ayuda please
Hola Bender, bienvenido y saludos a la hermana República del Uruguay
Aquí mismo tenemos un manual de OOo Basic para noveles http://user.services.openoffice.org/es/ ... =50&t=1545
El siguiente ejemplo, hace lo mismo que ti macro verinfo()
Supongo que la macro ocultarinfo(), que no muestras, hace lo contrario, puedes hace una sola que alterne entre mostrar y ocultar la información, como en:
La macro vertrim2() es muy parecida, así que te queda de tarea, solo veo una línea diferente (ActiveWindow.SmallScroll Down:=-6), que si mal no recuerdo, solo te desplaza en la ventana, esto claro, es posible también en OOo Basic...
La ultima macro, la veo un poco "confusa" y con algo de código de sobra, cuéntame que "hace" exactamente para mejorarla.
En el libro viene explicado como usar estas macros y cualquier otra.
Saludos desde México.
Mauricio
Aquí mismo tenemos un manual de OOo Basic para noveles http://user.services.openoffice.org/es/ ... =50&t=1545
El siguiente ejemplo, hace lo mismo que ti macro verinfo()
Código: Seleccionar todo
Sub verinfo()
Dim oHojaActiva As Object
Dim oRango As Object
Dim oCol As Object
oHojaActiva = ThisComponent.getCurrentController.getActiveSheet()
'Referencia al rango D1:H1
oRango = oHojaActiva.getCellRangeByName( "D1:H1" )
'Creamos una nueva referencia a las columnas
oCol = oRango.getColumns()
'Mostramos las columnas
oCol.IsVisible = True
'Seleccinamos la celda A10
ThisComponent.getCurrentController.select( oHojaActiva.getCellRangeByName("A10") )
End Sub
Código: Seleccionar todo
Sub MostrarOcultarInfo()
Dim oHojaActiva As Object
Dim oRango As Object
Dim oCol As Object
oHojaActiva = ThisComponent.getCurrentController.getActiveSheet()
'Referencia al rango D1:H1
oRango = oHojaActiva.getCellRangeByName( "D1:H1" )
'Creamos una nueva referencia a las columnas
oCol = oRango.getColumns()
'Alternamos entre visible y no visible
oCol.IsVisible = Not oCol.IsVisible
'Seleccinamos la celda A10
ThisComponent.getCurrentController.select( oHojaActiva.getCellRangeByName("A10") )
End Sub
La ultima macro, la veo un poco "confusa" y con algo de código de sobra, cuéntame que "hace" exactamente para mejorarla.
En el libro viene explicado como usar estas macros y cualquier otra.
Saludos desde México.
Mauricio
- Adjuntos
-
- Mostrar Ocultar Columnas.ods
- Ejemplo de mostrar y ocultar columnas
- (7.69 KiB) Descargado 292 veces
______________________________________________
"Todo cuanto no podemos dar nos posee". - André Gide
LibreOffice 6.2 | ArchLinux | Gnome3
No respondo preguntas privadas, por favor, usa el foro
"Todo cuanto no podemos dar nos posee". - André Gide
LibreOffice 6.2 | ArchLinux | Gnome3
No respondo preguntas privadas, por favor, usa el foro
Re: Pasar unas macros de excel a calc, ayuda please
Muchas gracias por la ayuda, igual me esta "calentando" la cabeza bastante.
Este script yo lo usaba para desmarcar un rango de celdas, las cuales "selecciono" de una lista desplegable con una simple letra x
Range("B17").Select
'While ActiveCell.Value <> "FIN"
While ActiveCell.Column < 136
If ActiveCell.Value <> "X" Then
Columns(ActiveCell.Column).Hidden = True
ActiveCell.Offset(0, 1).Select
Else
ActiveCell.Offset(0, 1).Select
End If
Wend
Range("B17").Select
End Sub
Te puedo jorobar una vez mas, porque oobasic no tiene nada que ver con vbasic, y me tiene remal.
Este script yo lo usaba para desmarcar un rango de celdas, las cuales "selecciono" de una lista desplegable con una simple letra x
Range("B17").Select
'While ActiveCell.Value <> "FIN"
While ActiveCell.Column < 136
If ActiveCell.Value <> "X" Then
Columns(ActiveCell.Column).Hidden = True
ActiveCell.Offset(0, 1).Select
Else
ActiveCell.Offset(0, 1).Select
End If
Wend
Range("B17").Select
End Sub
Te puedo jorobar una vez mas, porque oobasic no tiene nada que ver con vbasic, y me tiene remal.
OpenOffice 3.0 windows xp
Re: Pasar unas macros de excel a calc, ayuda please
yo probe esto, pero nada....
Dim oSheet as Object
oSheet = ThisComponent.CurrentController.ThisComponent.CurrentController.ActiveSheet
ThisComponent.CurrentController.select(oSheet.getCellDim oSheet as Object
oSheet = ThisComponent.CurrentController.ActiveSheet
oSheet.getCellRangeByName($1)ByName(("B17")))
'While ThisComponent.getCurrentSelection.Value <> "FIN"
While ThisComponent.getCurrentSelection.Column < 136
If ThisComponent.getCurrentSelection.Value <> "X" Then
Columns(ThisComponent.getCurrentSelection.Column).Hidden = True
ThisComponent.getCurrentSelection.Offset(0, 1).Select
Else
ThisComponent.getCurrentSelection.Offset(0, 1).Select
End If
Wend
Dim oSheet as Object
oSheet = ThisComponent.CurrentController.ThisComponent.CurrentController.ActiveSheet
ThisComponent.CurrentController.select(oSheet.getCellDim oSheet as Object
oSheet = ThisComponent.CurrentController.ActiveSheet
oSheet.getCellRangeByName($1)ByName(("B17")))
End Sub
Dim oSheet as Object
oSheet = ThisComponent.CurrentController.ThisComponent.CurrentController.ActiveSheet
ThisComponent.CurrentController.select(oSheet.getCellDim oSheet as Object
oSheet = ThisComponent.CurrentController.ActiveSheet
oSheet.getCellRangeByName($1)ByName(("B17")))
'While ThisComponent.getCurrentSelection.Value <> "FIN"
While ThisComponent.getCurrentSelection.Column < 136
If ThisComponent.getCurrentSelection.Value <> "X" Then
Columns(ThisComponent.getCurrentSelection.Column).Hidden = True
ThisComponent.getCurrentSelection.Offset(0, 1).Select
Else
ThisComponent.getCurrentSelection.Offset(0, 1).Select
End If
Wend
Dim oSheet as Object
oSheet = ThisComponent.CurrentController.ThisComponent.CurrentController.ActiveSheet
ThisComponent.CurrentController.select(oSheet.getCellDim oSheet as Object
oSheet = ThisComponent.CurrentController.ActiveSheet
oSheet.getCellRangeByName($1)ByName(("B17")))
End Sub
OpenOffice 3.0 windows xp
Re: Pasar unas macros de excel a calc
Probando.... pero nada.
Sub Desmarcar()
Dim oHojaActiva As Object
Dim oRango As Object
Dim oCol As Object
oHojaActiva = ThisComponent.getCurrentController.getActiveSheet()
oRango = oHojaActiva.getCellRangeByName( "B17:AS1" )
If ActiveCell.Value = "x" Then
ActiveCell.Value = " "
ActiveCell.Offset(0, 1).Select
Else
ActiveCell.Offset(0, 1).Select
End If
End Sub
Sub Desmarcar()
Dim oHojaActiva As Object
Dim oRango As Object
Dim oCol As Object
oHojaActiva = ThisComponent.getCurrentController.getActiveSheet()
oRango = oHojaActiva.getCellRangeByName( "B17:AS1" )
If ActiveCell.Value = "x" Then
ActiveCell.Value = " "
ActiveCell.Offset(0, 1).Select
Else
ActiveCell.Offset(0, 1).Select
End If
End Sub
OpenOffice 3.0 windows xp
Re: Pasar unas macros de excel a calc
Por favor, procura mantener una sola pregunta por hilo, si no, podrían ser hilos interminables, gracias y saludos...
Mauricio
Mauricio
______________________________________________
"Todo cuanto no podemos dar nos posee". - André Gide
LibreOffice 6.2 | ArchLinux | Gnome3
No respondo preguntas privadas, por favor, usa el foro
"Todo cuanto no podemos dar nos posee". - André Gide
LibreOffice 6.2 | ArchLinux | Gnome3
No respondo preguntas privadas, por favor, usa el foro