ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format text in a textbox (https://www.excelbanter.com/excel-programming/352849-format-text-textbox.html)

DB

Format text in a textbox
 
Is it possible to formate lines of text in a textbox with bullets? I was
hoping I could place a button that when clicked would format the paragraphs
with bullets. This textbox would be on a userform.

Anyone have any ideas?

avveerkar[_49_]

Format text in a textbox
 

DB Wrote:
Is it possible to formate lines of text in a textbox with bullets? I
was
hoping I could place a button that when clicked would format the
paragraphs
with bullets. This textbox would be on a userform.

Anyone have any ideas?


Since textbox supports only printable ASCII set, I think in true sense
you cannot format with bullets. But as a work around you could search
for a new line and add let us say "*" as bullet at the begining of new
line. You are then introducing additional characters ( eg. * ) but it
will appear to be formatted with bullets. A simple code line
Set TB = UserForm1.TextBox1
TB.Value= Replace(TB.Value, CHR$(10), "* ")
should do the trick.

A V Veerkar


--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=510452


DB

Format text in a textbox
 
Thank you for the suggestion, I'll make it happen. BTW, can you remind me
what the $ symbol in your CHR$ means?

"avveerkar" wrote:


DB Wrote:
Is it possible to formate lines of text in a textbox with bullets? I
was
hoping I could place a button that when clicked would format the
paragraphs
with bullets. This textbox would be on a userform.

Anyone have any ideas?


Since textbox supports only printable ASCII set, I think in true sense
you cannot format with bullets. But as a work around you could search
for a new line and add let us say "*" as bullet at the begining of new
line. You are then introducing additional characters ( eg. * ) but it
will appear to be formatted with bullets. A simple code line
Set TB = UserForm1.TextBox1
TB.Value= Replace(TB.Value, CHR$(10), "* ")
should do the trick.

A V Veerkar


--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=510452



Tom Ogilvy

Format text in a textbox
 
it means return a string. As I understand it, there really is no
difference between CHR and CHR$ in VBA 6.

? typename(chr(57))
String
? typename(chr$(57))
String



--
Regards,
Tom Ogilvy

"DB" wrote in message
...
Thank you for the suggestion, I'll make it happen. BTW, can you remind me
what the $ symbol in your CHR$ means?

"avveerkar" wrote:


DB Wrote:
Is it possible to formate lines of text in a textbox with bullets? I
was
hoping I could place a button that when clicked would format the
paragraphs
with bullets. This textbox would be on a userform.

Anyone have any ideas?


Since textbox supports only printable ASCII set, I think in true sense
you cannot format with bullets. But as a work around you could search
for a new line and add let us say "*" as bullet at the begining of new
line. You are then introducing additional characters ( eg. * ) but it
will appear to be formatted with bullets. A simple code line
Set TB = UserForm1.TextBox1
TB.Value= Replace(TB.Value, CHR$(10), "* ")
should do the trick.

A V Veerkar


--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile:

http://www.excelforum.com/member.php...o&userid=30338
View this thread:

http://www.excelforum.com/showthread...hreadid=510452






All times are GMT +1. The time now is 12:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com