writing array into excel sheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know, how to write an array into a sheet with c++ (vb). To let excel know that the range is an array, you have to use the ctrl+shift+enter combination. How can this be done with c++ (vb).
 
Berrie,

Here is a VB example:

Function myfunc() As Variant
Dim arr(9, 9) As String, i As Long, j As Long

For i = 0 To 9
For j = 0 To 9
arr(i, j) = CStr(i & ", " & j)
Next
Next

myfunc = arr
End Function

Select 10 by 10 cells:
=myfunc()
CTRL+SHIFT+ENTER

Rob

berrie said:
Does anyone know, how to write an array into a sheet with c++ (vb). To let
excel know that the range is an array, you have to use the ctrl+shift+enter
combination. How can this be done with c++ (vb).
 
Back
Top