Change label height at runtime

sykes

Well-known Member
Joined
May 1, 2002
Messages
1,885
Office Version
  1. 365
Platform
  1. Windows
Hi all

I'm using a label within a frame, on a form, so that I can have a lot of lines of info in the label, and allow the user to scroll down through them.
The number of lines of info on the label change, so the height of the label control needs to change dynamically.

I'm having trouble changing the height of the label at runtime - if I set the label's height to say, 500, then at runtime (in the initialize event) - using:
Code:
userform1.label1.height = 1500
.......doesn't alter the height, so I can't see the rows of info at the bottom of the label.

I've even tried incrementing the label's height as each additional line of data's added to it, but that doesn't work either.

Any bright ideas, anyone.

Thanks, in advance
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Norie
Thanks for you reply - yes - I could see the vbcrlf characters - but it was one long textstring - let me mess with this - I just seen there is a multiline property for a textbox - I did not try it - so sounds like I just gotta play with this.
Thanks
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top