Ennio-Sr wrote:
> 
> * Mark Knecht <[EMAIL PROTECTED]> [050207, 18:39]:
>> On 2/5/07, Ennio-Sr <[EMAIL PROTECTED]> wrote:
>> > [ snip ]
>> 
>> Hi Ennio,
>>   First, and again, thanks for your help on this.
>> 
>>   OK, I've installed your macro and figured out how to bind it to a
>> key. CTRL+A seems to be a default assignment to select all cells in
>> the spreadsheet so I bound it to CTRL+SHIFT+A and it seems to
>> function. However I have two problems:
>> 
>> 1) The macro moves the current location of the active cell to the cell
>> being written. The defeats the main thing I wanted which was to not
>> move away from the location I'm getting the value from. Can you think
>> of how to modify the macro so that it pastes the contents of the cell
>> I'm in into $A$1 but remains at the cell I'm in and doesn't move?
>> 
> 
> Hi Mark,
> this 'revised' macro would give you the possibility to stick to the cell
> you are into, but it lacks a function I've not been able to figure out,
> as I explain in the macro itself (see bottom)
> 
>> 2) Since my main spreadsheet page is a roll-up of a spreadsheet that
> 
> I'll examine this point later to see if I can help: be it clear that I'm
> no expert but just curious and have some time to spare ... ;-)
> 
> Perahps somebody  will help update Andrew Pitonyak function to get the
> readable cell address to return to.
> 
> Regards,
>       Ennio
> 
> <major snip>
> 
> 

Hi, Ennio.

I had to wrack the memory cells because I no longer use copyRange.  The
following copies the selected range to A1 of the sheet stipulated with
oDesSheet - indexing starts at 0 (zero).

Cheers.

'- - - code  - - -
Sub copySelecttoFC
'Copies current selection to A1 (First cell) of nominated sheet

Dim oSelect as Object, oSelSheet as Object, oDesSheet as Object, tDesto,
tSelect

oSelect = ThisComponent.getCurrentSelection ' the current selection
oSelSheet = oSelect.getSpreadsheet ' the sheet containing the current
selection
tSelect = oSelect.RangeAddress ' the range address of the selection
oDesSheet = ThisComponent.getSheets.getByIndex( 0 ) 
' The sheet to which the selection is to be copied - here, the first sheet
is the destination
tDesto = oDesSheet.getCellByPosition( 0, 0 ).CellAddress ' A1 of the
destination sheet
oSelSheet.copyRange( tDesto, tSelect ) 'copies range to A1 of destination
sheet

End Sub
'- - - end - - -
-- 
View this message in context: 
http://www.nabble.com/Calc-function-that-returns-the-value-of-the-current-cell--tf3167106.html#a8838387
Sent from the openoffice - users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to