ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying an array variable to a sheet (https://www.excelbanter.com/excel-programming/271551-copying-array-variable-sheet.html)

M Rose

Copying an array variable to a sheet
 
Hi all,

I need some help with my first steps into Excel programming (Excel 2000,
on windows XP)

I have a vector defined as

Dim zret() As Variant

' which later is redefined

ReDim zret(n,1)

' n can get any value and is to be determined elsewhere
' after zret is filled with processed data I would like to place it on
the active sheet.
' i do not want to use activesheet.range(" "), since it will require a
predefined location and length.

I have tried
r=2
c=4
'ActiveSheet.Range(Cells(r ,c ), Cells(r + n - 1, c + 1)) = zret

' but I'm getting an error.

Also, is there a way to name a range dynamically, with a number of
columns and or rows determined in the subroutine?


Thank you,
MR,
NYC









All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com