Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to import a 2-d array into excel using vba?
Hi, I am writing a macro in excel and I have created a 2-d array, populated
it with data, and I want to take the data from the array and put it into an excel worksheet. I have a loop that gets each array element an puts the data in a cell. Since my array contains a lot of data, using the loop takes a while to put the data into the worksheet. This macro is used to update worksheets in about 100 workbooks, so you see how I would need to optimize this as much as possible. Any help would be greatly appreciated. Krussell |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to import a 2-d array into excel using vba?
assume the array is named ar
dim rwcnt as long, colcnt as long rwcnt = ubound(ar,1) - lbound(ar,1) + 1 colcnt = ubound(ar,2) - lbound(ar,2) + 1 range("B9").Resize(rwcnt,colcnt).Value = ar -- Regards, Tom Ogilvy "Krussell172" wrote: Hi, I am writing a macro in excel and I have created a 2-d array, populated it with data, and I want to take the data from the array and put it into an excel worksheet. I have a loop that gets each array element an puts the data in a cell. Since my array contains a lot of data, using the loop takes a while to put the data into the worksheet. This macro is used to update worksheets in about 100 workbooks, so you see how I would need to optimize this as much as possible. Any help would be greatly appreciated. Krussell |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to import web query as array? | Excel Discussion (Misc queries) | |||
Import Text File Directly to an Array | Excel Programming | |||
VBA Import of text file & Array parsing of that data | Excel Discussion (Misc queries) | |||
import array text to row data in excel | Excel Programming |