vba to sit text boxes alongside each other

cjcass

Well-known Member
Joined
Oct 27, 2011
Messages
683
Office Version
  1. 2016
Platform
  1. Windows
Hi,
This may/may not be achievable - is there some code that will sit three text boxes on top of each other?
So the bottom edge of text box 1 sits adjacent to the top edge of text box 2 and the top edge of text box 3 sits adjacent to the bottom of text box 2? If poss. then could also do left/right edges with other text boxes too?
Rgds,
 
ok, understood - have only used the properties you have given and it works, thanks.

On this same subject I have another query if I may - I am running code that is changing the font size of text boxes and then positioning them next to each in different ways. The text boxes resize themselves to fit the new font size but even though they have 0cm margins in their properties there is still a margin in every text box which means I can't get the text boxes positioned as 'snug' next to each other as I want them - I'm looking for the text to be close to each other. I tried using rectangle shapes instead (adding text) as manually it looked like I was able to bring the margins in very close to the text, but when I run the code and the font sizes change margins are added again - is there some code or method that will get around this? I was considering positioning the text box using Height - 2 etc. to compensate for the margin however when the font size changes either bigger or smaller the '-2' would become inaccurate.
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
In your original post you said:
"This may/may not be achievable - is there some code that will sit three text boxes on top of each other?"

Would you care to tell us what your going to do with all these Textboxes?

Will you then be assigning some code to a button to load these textboxes with data?
 
Upvote 0
Hi,
Ok, let's go back to the original post as you have highlighted.
I now have code that will position the three text boxes on top of each other however the boxes have margins so there is a distance between the written text that I want to remove - is there a way of removing this space so the text is snug like a mini word cloud?
The text in each box is reading directly from a cell reference that will change, the font size changes by code.
 
Upvote 0
When you say on top of each other. If they were on top of each other how do you see values in each box?

Or do you mean above each other:
For example this line of text is below the previous line of text.

On top of each other in my thought's means:

The first floor of the Hotel is on top of the second floor of the Hotel.

You never said why you need all these textboxes.

You do know ActiveX Textboxes can be set as to be "Multiline"

Right click Activex Textbox select properties set "Multiline" to True
 
Upvote 0
Hi,
To confirm, as you have said they are 'one above the other', not on top of each other so you can't read the text - am making numerous, small, individual word clouds where the font size and text will change.
Not sure what the Multiline setting is for ActiveX Textboxes and whether it would do the job.
Rgds,
 
Upvote 0
A Textbox set to Multiline means you can enter more then one line of text in the Textbox


I'm not sure what a: "word cloud" is
 
Last edited:
Upvote 0
the 3 different words would be nestled together, each with a different font size
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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