Home > Net >  How to EXCEL in the cell range assignment?
How to EXCEL in the cell range assignment?

Time:09-21

For example the following code:
Dim as string s="$A $1, $B $4, $F $3, $G $7"
To put the "1", for example, "2", "3", "4" is assigned to this range, want to pass an array assignment directly, rather than through circulation, how to do?
Xlsheet. Range (s). Value=https://bbs.csdn.net/topics/?

CodePudding user response:

=directly

CodePudding user response:

Specific how to operate it, I will this A few string "1", "2", "3", "4", defined as array assignment, "$A $1, $B $4, $F $3 to $G $7" these cells are shown first address of the array value "1",

CodePudding user response:



Dim Range=sheet1. Range (s (0))
The Range=Range. Next. Next
It's jumping, use recursion can

CodePudding user response:

The great god, didn't understand you write, can write in a more specific?

CodePudding user response:

Upstairs each means to range assignment, this is the standard practice of excel operation,

, remember, like, probably, may... Directly on the top left corner can also be the first cell assignment,,,

CodePudding user response:

I will assign the content of the article have tens of thousands of data (screening out from the hundreds of thousands of data), if a a cell range assignment, I tried the need to more than 10 minutes, the speed is too slow, if the data cell, however, is just a rectangular area, direct range assignment, only 0.5 minutes, so I want to jump the cell can directly at the whole assignment, or one assignment, too slow,

CodePudding user response:

Great god ~ ~ ~ fast

CodePudding user response:

The great spirit appears quickly ~ ~ ~

CodePudding user response:

Array batch assignment, I now is through two-dimensional array
Put 1234 in a two dimensional array, the natural one dimension is 0, so you write data, can cross the assignment already, also can stand assignment,
Range. The Resize [rowscount Array, Array Columnscount]=Array

Complete the

I do,

Tens of thousands of multiple numerical seconds seconds to complete

CodePudding user response:

Try using the method of inserting array

 
Imports Spire. Xls

The Namespace Insert2DArray
Class Program
Shared Sub Main (ByVal args () As String)
Dim wb As Workbook=New Workbook ()
Dim sheet As Worksheet=wb. Worksheets (0)
Dim twoDimensionalArray (,) As Object=New String (,) {
{" a1 ", "b1", "c1", "d1"},
{" a2 ", "b2", "c2", "d2"},
{" a3 ", "b3", "c3", "d3"},
{" a4 ", "b4," "c4", "d4"}
}

Sheet. InsertArray (twoDimensionalArray, 1, 1)
Wb. SaveToFile (" InsertArray. XLSX, "ExcelVersion. Version2016)
End Sub
The End of the Class
End the Namespace
  • Related