1

Topic: To copy an array in a clipboard for an insertion method Ctrl+V

Good afternoon all great guru to programmers
Whether it is possible to solve such problem. There is at me filled ListBox, such idle time a label, in 4 columns with values. To me it is necessary from LisBox to copy all this data that the user could interpose them on other sheet Excel or even other book Excel
I now want to bring them in an array, and here then... At all I do not know, whether it is possible to translate an array in a clipboard, what that in the magic image?
To collect the data in an array - it is simple. And here is how so to make what they in a clipboard appeared?

Dim MyCopyMassivArr (11, 4) As Variant
For iCol = 0 To 3
For iRow = 0 To 10
MyCopyMassivArr (iRow, iCol + 1) = ListBox_Total. Column (iCol, iRow)
Next
Next

I there attached a file. UserForm it is caused double  to green lines on sheet. On a total on a city.
And can eat what that different ways to copy that that to me it is necessary.
Yes, I not copy cells in Excel. I copy that that already the macro collected in ListBox

2

Re: To copy an array in a clipboard for an insertion method Ctrl+V

Whether

lopuxi wrote:

it is possible to translate an array in a clipboard

It is possible. It is necessary to collect all in one string variable, thus single line elements lines - vbNewLine are divided vbTab, and then to place the received line in a clipboard method Clipboard. SetText (beforehand it is recommended to clear the buffer method Clipboard. Clear).

3

Re: To copy an array in a clipboard for an insertion method Ctrl+V

Akina wrote:

it is passed...
... Beforehand it is recommended to clear the buffer method Clipboard. Clear).

Unless there is object Clipboard in VBA?

4

Re: To copy an array in a clipboard for an insertion method Ctrl+V

And in VBA there are similar methods at Application.

5

Re: To copy an array in a clipboard for an insertion method Ctrl+V

Akina, Thanks!
Yes, council appeared very useful! Helped. A problem solved)