Home > Software engineering >  Ask: how does execl batch replacement of words and phrases
Ask: how does execl batch replacement of words and phrases

Time:10-14

After the completion of the table 1:
Table 2:
Table 1:

There are two tables,
Table 1 is to replace the table, include A column, A column of have more than one word or phrase in each cell and respectively; Separated,
Table 2 to replace the reference table, including A, B two columns, each cell of A column is only A word or phrase, the corresponding B as A Chinese translator,
Hope listed in table 1 B can translate, batch quantity is more, in the figure only lists the data from one cell,

CodePudding user response:

Sub division ()
Arr=Split (Range (" a1 "), ";" )
BRR=Split (Range (" b1 "), ";" )
Dim arr1 ()
ReDim arr1 (0 To UBound (arr))
Dim brr1 ()
ReDim brr1 (0 To UBound (BRR))
For I=0 To UBound (arr)
Arr1=arr (I) (I)
Next
For I=0 To UBound (BRR)
Brr1 (I)=BRR (I)
Next

[c1]. Resize (UBound (arr1) + 1, 1)=Application. WorksheetFunction. Transpose (arr1)
(d1). The Resize (UBound (brr1) + 1, 1)=Application. WorksheetFunction. Transpose (brr1)
End Sub
  •  Tags:  
  • VBA
  • Related