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

search and paste a rows

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


Joined: 23 Jul 2007
Posts: 5

PostPosted: Mon Jul 23, 2007 11:24 pm    Post subject: search and paste a rows Reply with quote

I have a macro in excel. I don't know how to change it for ooo's format. This macro search date (column A) in all sheets and copy rows (rows with this date appearance) to 'rob' sheet.
And sorry for my english Smile
This is a macro in excel:

Sub proba()
DT = InputBox("Podaj datę w formacie RRRR-MM-DD")
For arkusz = 1 To Sheets.Count
If Sheets(arkusz).Name <> "rob" Then
Sheets(arkusz).Select
KTG = Sheets(arkusz).Name

W = 1
Do
W = W + 1
If CStr(Cells(W, 1)) = DT Then
Rows(W).Select
Selection.Copy
Sheets("rob").Select
K = 1
Do
K = K + 1
Loop Until Worksheets("rob").Cells(K, 1) = ""
Worksheets("rob").Cells(K, 1).Select
ActiveSheet.Paste
Cells(K, 1) = KTG
Cells(1, 1) = DT
Sheets(KTG).Select
End If
Loop Until Cells(W, 1) = ""

End If
Next arkusz

End Sub
Back to top
View user's profile Send private message Send e-mail
jmoc
General User
General User


Joined: 04 Jan 2005
Posts: 23
Location: Brazil

PostPosted: Tue Jul 24, 2007 7:27 am    Post subject: Reply with quote

One tip to help

The Cell C4 in the first sheet of a Document:

In VBA Excel: Sheets(1).Cells(4,3)

Sheets, Rows, Collumns starts at 0
Cell(Row,Collumn)

In OOBasic: ThisComponent.Sheets(0).getcellbyposition(2,3)

Sheets, Rows, Collumns starts at 1
Cell(Collumn,Row)
_________________
J M O Carvalho
Rio de Janeiro - RJ
Brazil
Back to top
View user's profile Send private message Send e-mail
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