Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
2-dim array into sheet
Hi ya!
Do you know a way to "paste" a 2-dimensional array (calculated in macro) into a sheet (where one dimension will be rows and another on columns, obviously...) ? Help highly appreciated, Fabaliciou -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
2-dim array into sheet
Use something like the tested:
Option Explicit Function DimensionSize(Arr, Optional whatDim As Integer = 1) On Error Resume Next DimensionSize = UBound(Arr, whatDim) - LBound(Arr, whatDim) + 1 End Function Sub transferDataToXL() Dim SomeArr(2 To 21, 3 To 12) As Double, _ i As Integer, j As Integer For i = LBound(SomeArr, 1) To UBound(SomeArr, 1) For j = LBound(SomeArr, 2) To UBound(SomeArr, 2) SomeArr(i, j) = i / j Next j Next i Range("a1").Resize( _ DimensionSize(SomeArr, 1), DimensionSize(SomeArr, 2)).Value = _ SomeArr End Sub I will leave it up to you to figure out what portions of the above code were needed for testing and what do the actual work. ;-) -- Regards, Tushar Mehta www.tushar-mehta.com Multi-disciplinary business expertise + Technology skills = Optimal solution to your business problem Recipient Microsoft MVP award 2000-2004 In article , fabalicious says... Hi ya! Do you know a way to "paste" a 2-dimensional array (calculated in a macro) into a sheet (where one dimension will be rows and another one columns, obviously...) ? Help highly appreciated, Fabalicious --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
2-dim array into sheet
fabalicious < wrote:
Hi ya! Do you know a way to "paste" a 2-dimensional array (calculated in a macro) into a sheet (where one dimension will be rows and another one columns, obviously...) ? Range("A11").Resize(UBound(TwoDarray) - LBound(TwoDarray) + 1, _ UBound(TwoDarray, 2) - LBound(TwoDarray, 2) + 1).Value = TwoDarray Alan Beban |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Define a sheet in an array using a cell value | Excel Worksheet Functions | |||
Sheet(Array( Won't print as I expect it to | Excel Worksheet Functions | |||
writing array into excel sheet | Excel Programming | |||
Dumping the contents of a VBA array to a sheet | Excel Programming | |||
Copying an array variable to a sheet | Excel Programming |