CodePudding user response:
Code:
Private mblnUpdating As Boolean
Private Sub Worksheet_Change (ByVal Target As Range)
If mblnUpdating Then
The Exit Sub
End the If
MblnUpdating=True
Dim strContent As String
StrContent=Target. The Text
Dim strTemp As String
For I=1 To Len (strContent)
StrTemp=strTemp & amp; Mid (strContent, I, 1)
If I Mod 10=0 Then
SetCellValue Target. The Row, and the Target. The Column + (I \ 10) - 1, strTemp
StrTemp=""
End the If
Next
If strTemp & lt;> "" Then
SetCellValue Target. The Row, and the Target. The Column + ((I - 1) \ 10), strTemp
End the If
MblnUpdating=False
End Sub
Private Sub SetCellValue (ByVal intRow As an Integer, ByVal intColumn As an Integer, ByVal strValue As String)
Dim objRange As Range
The Set objRange=Cells (intRow intColumn)
ObjRange. NumberFormatLocal="@"
ObjRange=strValue
End Sub
Run the example:
Download address:
Link: https://pan.baidu.com/s/1WB_W0ph6-JTUcy6KQ3EXBQ
The extracted code: DRTK