trying to write a macro to automatically select a range of cells and copy them to my clipboard, as if i pressed ctrl-c.
Sub copy_1
oCtrl = ThisComponent.CurrentController
dim range As Variant
range = Array("A", "B", "C", "D")
dim last_row As integer
last_row = 3
for row = 3 to 100
rem Scann Document for blank line
for i = 0 to 3
dim test as Variant
test = oCtrl.ActiveSheet.GetCellRangeByName (range(i) + CStr(row))
If test.value <> 0 or test.string <> "" Then
last_row = row
end if
next
next
oCtrl.Select(oCtrl.ActiveSheet.GetCellRangeByName("A1:"+"F"+last_row))
copy() -- I need something that will work here.
End Sub
I got the selection part of the code down I just need to figure out how to send the copy command. Any ideas?