Using a macro, I want to copy whatever contents are in Sheet1,B2:D5 into Sheet2,A1 as a 'header cell'. There are numerous 'flirting around the edge' pages in the web on this but I can't uncover anything specific and I'm not able to adapt their code what I want to do, which is hugely disappointing as I had hoped to be be able to 'self generate' code in LO basic by now but apparently not :( Would someone be so kind as to post a simple macro as to how to do this?
Edit: Here's where I am...
Sub try6
Dim oSourceSheet as Object
Dim oTargetSheet as Object
Dim SourceRange As New com.sun.star.table.CellRangeAddress ' SourceRange with later Sheet1 like properties of what to copy '
Dim TargetRange As New com.sun.star.table.CellAddress ' TargetRange with later Sheet2 like properties of what to copy '
oSourceSheet = ThisComponent.Sheets.getByName("Sheet1")
oTargetSheet = ThisComponent.Sheets.getByName("Sheet2")
oSourceRange = oSourceSheet.getCellRangeByName("B2:D3") ' Specify the range to copy
oTargetRange = oTargetSheet.getCellRangeByName("A1") ' Specify the header cell for pasting
oTargetSheet.copyRange(TargetRange, SourceRange) ' Now nothing at all happens when the macro triggering button is pressed
End Sub
P.S. I can do it using loops, but as a 'paste block range' is where I fall down but that's how I want to do it.
