| View previous topic :: View next topic |
| Author |
Message |
Montse Guest
|
Posted: Thu Apr 24, 2003 6:46 am Post subject: VB - Copy cells and Insert cells in other sheet |
|
|
Hi,
I 'm trying to copy a range of cells of a sheet and insert it in other sheet of other worksheet.
I don't find the way to do this simple, because I have done this very complicated and now I have the trouble that I don't paste the style of the cells.(Bold,..
Do you know any method?
I have find de method INSERTCELLS but non-empty cells cannot be moved off the sheet.
Thanks,
Montse[/b] |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
Posted: Thu Apr 24, 2003 1:39 pm Post subject: |
|
|
If the Dispatcher approach is suitable for you ... use the macro recorder to get the basic framework like:
| Code: | document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$C$16:$D$16"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Nr"
args3(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args3())
args1(0).Name = "ToPoint"
args1(0).Value = "$C$16:$D$16"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
|
This copies and pastes values and format between sheets in a single document |
|
| Back to top |
|
 |
Montse Guest
|
Posted: Fri Apr 25, 2003 7:19 am Post subject: |
|
|
| Thanks, but I 'm developing with Visual Basic. I 'll search something like this. |
|
| 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
|