Home > Software engineering >  Ask: the excel can sort the data according to specified number automatically generate???????
Ask: the excel can sort the data according to specified number automatically generate???????

Time:11-19

Like table, first name format is: room number - D1, and then I was in accordance with the port number a a drag, a list because there are hundreds of thousands of lines, so I want to ask is there any way I can quickly generate the data

CodePudding user response:


 
Sub test ()
Dim As Long I
Dim row As Long
The row=2
With the Application. The ActiveSheet

Do While. Cells (row 1). The Text & lt;> "
"For I=1 To Val (. Cells (row, 2). The Text)
Cells (a row, I + 2)=. Cells (row 1). The Text & amp; "3-d" & amp; I
Next
DoEvents
The row row + 1=
Loop
End With
End Sub

CodePudding user response:

reference 1/f, crispy big ice cream reply:
 
Sub test ()
Dim As Long I
Dim row As Long
The row=2
With the Application. The ActiveSheet

Do While. Cells (row 1). The Text & lt;> "
"For I=1 To Val (. Cells (row, 2). The Text)
Cells (a row, I + 2)=. Cells (row 1). The Text & amp; "3-d" & amp; I
Next
DoEvents
The row row + 1=
Loop
End With
End Sub


Ok, thank you, saved me a lot of time

CodePudding user response:

reference zero distance of distant second floor response:
Quote: reference 1/f, crispy big ice cream reply:

 
Sub test ()
Dim As Long I
Dim row As Long
The row=2
With the Application. The ActiveSheet

Do While. Cells (row 1). The Text & lt;> "
"For I=1 To Val (. Cells (row, 2). The Text)
Cells (a row, I + 2)=. Cells (row 1). The Text & amp; "3-d" & amp; I
Next
DoEvents
The row row + 1=
Loop
End With
End Sub


Ok, thank you, saved me a lot of time


The knot to stick
  •  Tags:  
  • VBA
  • Related