OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

WHo can help me build a macro in OOo basic like this one

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Contje007
Guest





PostPosted: Fri Feb 13, 2004 12:46 am    Post subject: WHo can help me build a macro in OOo basic like this one Reply with quote

Sub ResetSheets()

' Macro recorded 13/11/2001 by Filip Heymans

'*****************************************************
'* deze macro herstelt de originele sheet-layout *
'*****************************************************

'deleten vd kolommen 'It.Group' & 'Art-Cont'
'en de eerste rij uit de tabel met de kostprijzen
Sheets("Kostprijzen").Select
ActiveSheet.AutoFilterMode = False
Columns("I:I").Select
Selection.Delete Shift:=xlToLeft
Columns("DVery Happy").Select
Selection.Delete Shift:=xlToLeft
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Range("A1").Select

'deleten vd kolom 'Art-Cont'
'en de eerste rij uit de artikel-tabel
Sheets("Artikels").Select
ActiveSheet.AutoFilterMode = False
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Range("A1").Select




End Sub
Back to top
Ian Laurenson
Guest





PostPosted: Fri Feb 13, 2004 12:34 pm    Post subject: Formulas into cells and inserting rows Reply with quote

This should get you started - Cheers, Ian
Code:

Sub KolommenToevoegen()
'Macro written by Ian Laurenson to demonstrate how to change the
' Macro recorded 13/11/2001 by Filip Heymans in Excel to OOo Basic

Dim AR As Variant
Dim Bereik As Variant
dim oDoc as object
Dim oSheet1 as object, oRangeOrg as object
Dim oSheet2 as object, oRangeCpy as object, oCellCpy as object

oDoc = StarDesktop.CurrentComponent


TimingMacro "E24"

'bewerking sheet 'artikels'
oSheet = oDoc.Sheets.getByName("Artikels")

'creatie teller
'Rows("1:1").Select
'Selection.Insert Shift:=xlDown
oSheet.rows.insertByIndex(0, 1)   'col & row indexes start at zero

'Range("A1").Select
'ActiveCell.FormulaR1C1 = "=SUBTOTAL(3,R[2]C:R[49999]C)"
'AR = Cells(1, 1).Value
oSheet.getCellRangeByName("A1").setFormula("=subtotal(3;A3:A32000)")

'extra kolom 'Art-Cont'
'Columns("A:A").Select
'Selection.Insert Shift:=xlToRight
oSheet.columns.insertByIndex(0, 1)

'Range("A2").Select
'ActiveCell.FormulaR1C1 = "Art-Cont"
oSheet.getCellRangeByName("A1").string = "Art-Cont"

'Range("A3").Select
'ActiveCell.FormulaR1C1 = "=RC[10]&"" - ""&TRIM(RC[9])"
oSheet.getCellRangeByName("A3").setFormula("=J3&" & chr(34) & " - " & chr(34) & "&TRIM(I9)")


'Leave the rest as an exercise for you


TimingMacro "E26"
Beep
Beep
Beep
End Sub

Sub TimingMacro(sCell as string)
StarDesktop.CurrentComponent.sheets.getbyName("legende").getCellRangeByName(sCell).value = now
end sub
Back to top
someone new
Guest





PostPosted: Sun Feb 15, 2004 11:46 pm    Post subject: thanx : ) but wich part of my code do i have to translate Reply with quote

hey dude thanx for helping me but I have read the code and I don't know wich part is missing from the code could you help me please ???

thanx for helping me ; )
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group