Hi,
I have a userform with a TextBox multiline. Content of this textbox is inserted into a cell.
I would have that between 1st and 2nd line there is html tag <br>.
How can I do this?
regards
monak83
Hi,
I have a userform with a TextBox multiline. Content of this textbox is inserted into a cell.
I would have that between 1st and 2nd line there is html tag <br>.
How can I do this?
regards
monak83
Last edited by monak83; 04-20-2012 at 04:59 AM.
try to use chr(10)
![]()
activecell.value = "one line" & chr(10) & "second line etc."
Best Regards
MaczaQ
---------------------------------------------------------------------------------------------------------------------------
If you are satisfied with the solution(s) provided, please mark your thread as Solved
If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
- This way you will add him some reputation points ... thanks in advance.
Sorry but I'm not expert VB/Excel.
I have a textboxt where I can write in multiline (SHIFT+ENTER).
When I go into cell (on excel page) I see my text in two line.
I would have into cell the text in a single line with between two linees the html tag "<br>".
How can I do?
regards
monak83
just attach your workbook with that textbox then I will do it for you
In my file the TextBox is named TextBox5 with label DESCRIZIONE.
Thanks so much for your help
user_form_ACCESSORI.xlsm
Last edited by monak83; 04-19-2012 at 02:39 PM.
Hello monak83 ,
What is the name of the Texbox?
Which cell will the text be placed into?
Do you want the text placed in the cell after the second line is entered?
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Hello monka83,
Change the line below...
![]()
' From this Worksheets("Prodotti").Cells(iRR, 17).Value = TextBox5.Text 'Colonna Q ' To This Worksheets("Prodotti").Cells(iRR, 17).Value = Replace(TextBox5.Text, vbCrLf, "<BR>") 'Colonna Q
Attachment 151352Thanks so much, your code works perfectly.
Now I have add 2 CheckBox: CheckBox1 and CheckBox2 with relative TextBox14 and TextBox15.
If I check CheckBox1 I would write into TextBox5 a string like "Capo di seconda scelta" followed by Text insered in TextBox14
Same Thing for CheckBox15 with string "Rientro Sfilata" followed by Text insered in TextBox15.
If I check both checkbox I would have both strings and texts.
How Can I do?
I attach the new file.
Thanks so much.
monak83
Last edited by monak83; 04-19-2012 at 04:32 PM.
Hello monak83 ,
Grazie per la spiegazione.
Hello monka83,
There is a problem with your attachment. Please remove it and upload the file again.
Try Now Here
user_form_ACCESSORI2.xlsm
Hello monak83,
Here is the revised code for the button.
![]()
Private Sub CommandButton1_Click() Dim vTemp As Variant Dim iRR As Long Dim Tesso As String ' Calcolo la riga in cui inserire i dati (la prima riga libera) iRR = UltimaRiga ' posso a questo punto inserire i dati With Worksheets("Prodotti") .Cells(iRR, 1).Value = "admin" .Cells(iRR, 2).Value = "base" .Cells(iRR, 3).Value = "simple" .Cells(iRR, 4).Value = "Abilitato" .Cells(iRR, 5).Value = "Catalogo, cerca" .Cells(iRR, 6).Value = "Accessori" .Cells(iRR, 8).Value = TextBox6.Text .Cells(iRR, 9).Value = TextBox6.Text .Cells(iRR, 10).Value = TextBox6.Text .Cells(iRR, 11).Value = TextBox7.Text .Cells(iRR, 25).Value = "1" .Cells(iRR, 27).Value = "1" .Cells(iRR, 28).Value = "Product Info Column" .Cells(iRR, 7).Value = TextBox3.Text ' Colonna 1 (A) .Cells(iRR, 12).Value = TextBox4.Text ' Colonna 2 (B) .Cells(iRR, 13).Value = ComboBox1.Text .Cells(iRR, 14).Value = ComboBox7.Text .Cells(iRR, 15).Value = ComboBox8.Text .Cells(iRR, 16).Value = ComboBox9.Text Tesso = "Suola interna in cm:" + _ TextBox11.Text _ + " " + "-" + " " + "Tacco:" + TextBox12.Text _ + " " + "-" + " " + "Plateaux:" + TextBox13.Text _ + "<BR>" If CheckBox1.Value = True Then Tesso = Tesso & CheckBox1.Caption & ": " & TextBox14.Text & "<BR>" End If If CheckBox2.Value = True Then Tesso = Tesso & CheckBox2.Caption & ": " & TextBox15.Text & "<BR>" End If .Cells(iRR, 17).Value = Tesso & Replace(TextBox5.Text, vbCrLf, "<BR>") .Cells(iRR, 18).Value = ComboBox10.Text .Cells(iRR, 19).Value = ComboBox2.Text .Cells(iRR, 20).Value = ComboBox3.Text .Cells(iRR, 21).Value = ComboBox4.Text .Cells(iRR, 22).Value = ComboBox5.Text .Cells(iRR, 23).Value = ComboBox6.Text .Cells(iRR, 24).Value = TextBox9.Text .Cells(iRR, 26).Value = TextBox10.Text End With ' dato che non esiste nessun controllo la doppi pressione sul bottone ' provoca due inserimenti per evitare chiudo e scarico il Form Unload Me UserForm1.Show End Sub
Thanks so much!!!
Hello monak83,
Siete benvenuto. Che cosa è il significato di "Rientro Sfilata"?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks