Private Sub b1_Click() Dim b() As String, i As Integer b = Split(Text1, vbCrLf) Text2 = "" For i = 0 To UBound(b) If b(i) <> "" Then Text2 = Text2 & "'" & b(i) & "'," & vbCrLf Next Text2 = Left(Text2, Len(Text2) - 3)
End Sub
'本代码具有通用性,不管text1有多少行都能满足要求