I want to combine and add it in the textbox.. For information I want to show vbCrLf in the textbox not adding new line. The problem in the findlabel text. I don't manually but the listbox items always changing.. How I can code for FindLabel text?
Dim n As Long
TextBox7.Text = ""
For n = 0 To ListBox2.ListCount - 1
TextBox7.Text = TextBox7.Text & "[" & ListBox2.List(n) & "]"
If n <> ListBox2.ListCount - 1 Then TextBox7.Text = TextBox7.Text & ", "
Next n
TextBox7.Text = "Function FindLabel ( " & TextBox7.Text & ")" & vbCrLf & _
"FindLabel = [Code] & vbCrLf & [N] & vbCrLf & [name]" & vbCrLf & _
"End Function"
i am not sure what you are trying to achieve, do you want all the vbCrLf to display in the textbox as text or new lines, or some of each?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete