Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an existing VisualBasic routine which reads some data files and
prints results to a file. I have been then importing them to Excel to use it plot feature. Realized I could do whole thing in Excel. Before lunch, I found appropriate reference in Help which had comments on doing a sequence of calculations and placing them sequential cells. It's after lunch, and I can't find the reference. [It had a caution about referencing cells as an array rather than A1..A23 etc.] Could someone point me back in right direction. Using ( too infrequently Excel 97) Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can assign an array to a range in one step. The array must be two
dimensional: Dim vMyArray As Variant Dim i As Long ReDim vMyArray(1 To 10, 1 To 1) For i = 1 To 10 vMyArray(i, 1) = i Next i Range("A1:A10").Value = vMyArray Note that using Application.Transpose coerces a 1-dimensional array to two dimensions: Dim nMyArray(1 To 10) As Long Dim i As Long For i = 1 To 10 nMyArray(i) = i Next i Range("A1:A10").Value = Application.Transpose(nMyArray) In article , Richard Owlett wrote: I have an existing VisualBasic routine which reads some data files and prints results to a file. I have been then importing them to Excel to use it plot feature. Realized I could do whole thing in Excel. Before lunch, I found appropriate reference in Help which had comments on doing a sequence of calculations and placing them sequential cells. It's after lunch, and I can't find the reference. [It had a caution about referencing cells as an array rather than A1..A23 etc.] Could someone point me back in right direction. Using ( too infrequently Excel 97) Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks.
JE McGimpsey wrote: You can assign an array to a range in one step.[SNIP] Note that using Application.Transpose coerces a 1-dimensional array to two dimensions: Dim nMyArray(1 To 10) As Long Dim i As Long For i = 1 To 10 nMyArray(i) = i Next i Range("A1:A10").Value = Application.Transpose(nMyArray) This isn't what I saw. BUT, is a much more *readable* approach. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
cells do not show results of calculations | Excel Discussion (Misc queries) | |||
Conditional Calculations with Calculated Results | Excel Worksheet Functions | |||
N/A results on vlookup with time calculations | Excel Worksheet Functions | |||
Copying formulas without changing previous results/calculations | Excel Worksheet Functions | |||
Help on performing calculations on formula results | Excel Worksheet Functions |