| View previous topic :: View next topic |
| Author |
Message |
uberdruck General User

Joined: 23 Jul 2007 Posts: 5
|
Posted: Mon Jul 23, 2007 11:24 pm Post subject: search and paste a rows |
|
|
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
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 |
|
 |
jmoc General User

Joined: 04 Jan 2005 Posts: 23 Location: Brazil
|
Posted: Tue Jul 24, 2007 7:27 am Post subject: |
|
|
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 |
|
 |
|
|
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
|