View Single Post
  #8   Report Post  
BizMark BizMark is offline
Member
 
Location: London
Posts: 78
Default

The above formulas will work fine, but only really for the very specific example given.

If you're confident with pasting code into a VBA module, I suggest these two little macros (put them together in the same module) - I've replaced logical operators with words to stop them disappearing on the forum, so where you see EQUALS, type the equals sign:

'###CODE BEGINS HERE
Public xSel As Range

Sub CopyCustom()
Set xSel EQUALS Selection.Cells
End Sub

Sub PasteCustom()
nCell EQUALS 0

For Each xCell In Selection.Cells
nCell EQUALS nCell + 1
xCell.Value EQUALS xSel.Cells(nCell).Value
Next xCell
End Sub
'###CODE ENDS HERE

I suggest assigning these to two keys - perhaps CTRL+D and CTRL+F respectively. What you would then do is:

1. Select the source data array (any shape)
2. Run 'CopyCustom'
3. Select the destination data array (any shape)
4. Run 'PasteCustom'.

So, to implement your example above, you would select A1:C4 in the source sheet, run CopyCustom, then select A1:A12 (or more cells down if you can't be bothered to make sure you select exactly 12) in your OTHER worksheet and run PasteCustom.

This will transform the data from the original range shape to the selected range shape. Try it with different range shapes and see what happens. You may ultimately find this a more flexible solution to an algebraic function.

Regards,
MB

Last edited by BizMark : March 22nd 06 at 04:51 PM