Solved

Multiple text lines with a MSFlexgrid cell

Posted on 2000-05-07
4
279 Views
Last Modified: 2012-06-27
I'm looking for a simple way to cause information within cells of an MSFlexGrid to appear on two separate lines?  I'm not talking about word wrap here.  Rather, I wish the displayed  data to be separated at a specific place within the text -- somewhat like one would expect to get with a CRLF.
0
Comment
Question by:lennyh
4 Comments
 
LVL 32

Accepted Solution

by:
Erick37 earned 50 total points
Comment Utility
Private Sub Command1_Click()
    With MSFlexGrid1
    .WordWrap = True
    .RowHeight(1) = TextHeight("()") * 3.5 '3 lines
    .Row = 1
    .Col = 1
    .Text = "Line1" & vbCrLf & "Line2" & vbCrLf & "Line3"
    End With
End Sub
0
 
LVL 1

Expert Comment

by:pauljk
Comment Utility
You can also use chr(13) in place of vbCrLf
0
 
LVL 7

Expert Comment

by:Vbmaster
Comment Utility
Just a little note...

vbCr = Chr(13)
vbLf = Chr(10)
vbCrLf = Chr(13) + Chr(10)
0
 

Author Comment

by:lennyh
Comment Utility
Thanks to all for your clear responses and helpful information.

Lenny
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now