Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wraping text to next line

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Wraping text to next line

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Wraping text to next line

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? No Name Excel Worksheet Functions 7 October 7th 09 11:10 AM
Wraping Text Lisslou Excel Discussion (Misc queries) 2 January 7th 09 01:21 PM
wraping columns Notbobathome Excel Worksheet Functions 3 September 13th 08 01:50 AM
wraping text in a Forms check box Ableaarn73 Excel Discussion (Misc queries) 1 August 16th 06 07:39 PM
A 2 line text showing up in the Cell in Excel prints in 1 line Danny Excel Discussion (Misc queries) 6 July 12th 05 08:47 PM


All times are GMT +1. The time now is 01:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"