Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am having trouble wraping text to the next row.
My code is: Private Sub Submit_LNotes_Click() With Worksheets("Notes") cLastRow = .Cells(Rows.Count, "H").End(xlUp).Row .Cells(cLastRow + 2, "H").Value = "Top Number: " & TopNum.Text .Cells(cLastRow + 3, "H").Value = "Part Number: " LPartNum.Text .Cells(cLastRow + 4, "H").Value = " " & LNotes_Box.Text End With LNotesForm.Hide End Sub In my third cell that gets information inserted into it, the text ma be longer that one row. How do I get this to wrap the text onto th next row so that it stays visible. When I use the wrap text option under Format Cells it wraps the text but you can only see it if th cell is selected. Is their a way to wrap the text onto the next row? Thank you, Morr -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try:
Cells(cLastRow + 4, "H").EntireRow.Autosize after you enter the text. How much text are we talking about? or you can do something like this: sStr1 = LNotes_Box.Text iloc = instr(len(sStr1)/2,sStr1," ",vbTextCompare) Cells(cLastRow + 4, "H").Value = " " & Left(sStr1,iloc-1) Cells(cLastRow + 5, "H").Value = " " & Right(sStr1,Len(sStr1)-iloc) as in Sub BBBB() Dim sStr1 As String Dim iloc As Long Dim cLastRow As Long cLastRow = 5 sStr1 = "The quick brown fox jumped over the lazy dog's back" iloc = InStr(Len(sStr1) / 2, sStr1, " ", vbTextCompare) Cells(cLastRow + 4, "H").Value = " " & Left(sStr1, iloc - 1) Cells(cLastRow + 5, "H").Value = " " & Right(sStr1, Len(sStr1) - iloc) End Sub -- Regards, Tom Ogilvy "morry " wrote in message ... I am having trouble wraping text to the next row. My code is: Private Sub Submit_LNotes_Click() With Worksheets("Notes") cLastRow = .Cells(Rows.Count, "H").End(xlUp).Row Cells(cLastRow + 2, "H").Value = "Top Number: " & TopNum.Text Cells(cLastRow + 3, "H").Value = "Part Number: " & LPartNum.Text Cells(cLastRow + 4, "H").Value = " " & LNotes_Box.Text End With LNotesForm.Hide End Sub In my third cell that gets information inserted into it, the text may be longer that one row. How do I get this to wrap the text onto the next row so that it stays visible. When I use the wrap text option, under Format Cells it wraps the text but you can only see it if the cell is selected. Is their a way to wrap the text onto the next row? Thank you, Morry --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe this:
Cells(myrow, mycolumn).WrapText = True will wrap text around and adjust the rowheight Ko Vijn "morry " schreef in bericht ... I am having trouble wraping text to the next row. My code is: Private Sub Submit_LNotes_Click() With Worksheets("Notes") cLastRow = .Cells(Rows.Count, "H").End(xlUp).Row .Cells(cLastRow + 2, "H").Value = "Top Number: " & TopNum.Text .Cells(cLastRow + 3, "H").Value = "Part Number: " & LPartNum.Text .Cells(cLastRow + 4, "H").Value = " " & LNotes_Box.Text End With LNotesForm.Hide End Sub In my third cell that gets information inserted into it, the text may be longer that one row. How do I get this to wrap the text onto the next row so that it stays visible. When I use the wrap text option, under Format Cells it wraps the text but you can only see it if the cell is selected. Is their a way to wrap the text onto the next row? Thank you, Morry --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? | Excel Worksheet Functions | |||
Wraping Text | Excel Discussion (Misc queries) | |||
wraping columns | Excel Worksheet Functions | |||
wraping text in a Forms check box | Excel Discussion (Misc queries) | |||
A 2 line text showing up in the Cell in Excel prints in 1 line | Excel Discussion (Misc queries) |