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

Help me...convert excell VBA to OOo macro.....

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
bhq76
Newbie
Newbie


Joined: 09 Jun 2010
Posts: 4

PostPosted: Wed Jun 16, 2010 8:32 pm    Post subject: Help me...convert excell VBA to OOo macro..... Reply with quote

please help me....

I still new learn about OOo macro, my macro in excell file dont work with calc..macro
please help me, how to convert this.....

{}
Sub ok()
Dim wo, msn, job, op, qti, tmi, ot, spe, dime As String
Dim tgln As Date

Sheets("lapro").Select
Range("a5").Select

Set Sheet = Sheets("menu1")

tgln = Sheet.Range("c4").Value
wo = Sheet.Range("c5").Value
msn = Sheet.Range("c6").Value
op = Sheet.Range("c7").Value
job = Sheet.Range("c8").Value
spe = Sheet.Range("c9").Value
dime = Sheet.Range("c10").Value
qti = Sheet.Range("c11").Value
tmi = Sheet.Range("c12").Value
ot = Sheet.Range("c13").Value

Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True

ActiveCell.Formula = Day(tgln)
ActiveCell.Offset(0, 1).Formula = Month(tgln)
ActiveCell.Offset(0, 2).Formula = Year(tgln)
ActiveCell.Offset(0, 3).Value = wo
ActiveCell.Offset(0, 4).FormulaR1C1 = "=VLOOKUP(RC[-1],wo!R5C2:R500C8,4,)"
ActiveCell.Offset(0, 5).FormulaR1C1 = "=VLOOKUP(RC[-2],wo!R5C2:R500C8,6,)"
ActiveCell.Offset(0, 6).FormulaR1C1 = "=VLOOKUP(RC[-3],wo!R5C2:R500C8,5,)"
ActiveCell.Offset(0, 7).Value = msn
ActiveCell.Offset(0, Cool.Value = op
ActiveCell.Offset(0, 9).Value = job
ActiveCell.Offset(0, 10).Value = spe
ActiveCell.Offset(0, 11).Value = dime
ActiveCell.Offset(0, 12).Value = qti
ActiveCell.Offset(0, 13).Value = tmi
ActiveCell.Offset(0, 14).Value = ot

End Sub
{}


thank's
Back to top
View user's profile Send private message
aloarjr810
OOo Enthusiast
OOo Enthusiast


Joined: 04 Jun 2008
Posts: 113

PostPosted: Sat Jun 26, 2010 7:42 am    Post subject: Reply with quote

Try adding this at the beginning of your macro. This will let some excel macros work.


Code:

Option VBASupport 1 'add this

Sub ok()
Dim wo, msn, job, op, qti, tmi, ot, spe, dime As String
Dim tgln As Date
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc 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