Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting Range value using a single dimension array
I am writing a VSTO addin for Excel using Visual Studio 2005. I am
attempting to set the value for a range of cells using a one dimensional string array. However, only the first string in the array is being set in each cell in the range. I've read about a Transpose function, but this is not available in the Microsoft.Office.Interop.Excel.Application class. Here's a code sample: string[] valArray = new string[3]; valArray[0] = (string)"some data 1"; valArray[1] = (string)"blah"; valArray[2] = (string)"blah 2"; Excel.Range evenRange = this.Application.get_Range("A2,A4,A6", Type.Missing); evenRange.set_Value(Type.Missing, valArray); This code puts "some data 1" in cells A2, A4,and A6. I will also need to be able to set a range containing cells in a single row, rather than a single column. Is the code for doing this any different? Thanks for any assistance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) | Excel Programming | |||
Put values into excel range from single dimension array | Excel Programming | |||
Mutli-dimensional Array to Single-Dimension Array | Excel Programming | |||
Writing Single Dimension Array to Active Sheet | Excel Programming | |||
single dimension array | Excel Programming |