Excel sheet textbox

Found a strange behavior for Excel sheet textboxes.
Textbox in Excel sheet, and not the VBE textbox


Public

Tested

My Own Work
Enter in Textbox in Excel sheets is 1 char and not 2 chars as we used to have it
After few hours of bouncing my head against the wall, it looks like this is the only reason.

How I found it:
You see, my mistake was that I was building the multi-line text by adding vbCrLf after each line.
But Textbox treats an enter as 1 char and not 2.

The Solution:
When trying to build text to put inside a textbox, use the vbCr (or vbLf) instead of vbCrLf, to make sure that you treat the text similar to the textbox.

When:
Found during work with WW Rutherford and creating a dynamic textbox in sheet ToC (Table of Content).

Views 80 Downloads 14

VBA-Excel Learning Materials
ANmarAmdeen
714
Attachments
Revisions

v1.0