Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Super quick one - dumping an array to a range

Status
Not open for further replies.

Mightyginger

Programmer
Feb 27, 2003
131
US
I have an array Date(0 to 15, 0 to 1) and I want to dump it to two columns on a sepcific sheet, say sheet5.

This command works
Sheet5.Range("A1:B100") = use_this_array
but i want it to be more dynamic so that I can specify which column should be the first one and what row should be the top row. I will have somewhere in the spreadsheet the row and column number which will be read into the code.
I had thought this would work
Sheet5.Range(Cells(3, column), Cells(19, (column + 1))) = use_this_array
this si just for shifting the column but it doesn't like that, it says "Method 'Range' of object '_Worksheet' failed."
column=4 in this case.

Any suggestions of how I might be able to get it working please?


Many thanks,



Neil.
 
And this ?
Sheet5.Range(Sheet5.Cells(3, column), Sheet5.Cells(19, (column + 1))) = use_this_array

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks very much. Sorry, seems obvious now.

I really do appreciate that though,


Neil.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top