One of my first VBA forms, and I am stumped here....
In VB if select a number of controls, then select format, you can align the controls at one time. Is there a way to do this simply, in Excel VBA ?
Printable View
One of my first VBA forms, and I am stumped here....
In VB if select a number of controls, then select format, you can align the controls at one time. Is there a way to do this simply, in Excel VBA ?
Nope, you need to code in each controls location.
VB Code:
msgbox ("You have got to be kidding me"), vbExclamation
(thanks for the help anyway)
Its a pain but it would like this...
VB Code:
Me.TextBox1.Move 100, 10, 1250, 345, False Me.TextBox2.Move 100, Me.TextBox1.Top + Me.TextBox1.Height + 24, 1250, 345, False Me.TextBox3.Move 100, Me.TextBox2.Top + Me.TextBox2.Height + 24, 1250, 345, False 'etc.
needless to say, this could be time consuming with a fair amount of controls.
:(
Yeah you can in designer...
Use ctrl to select more than one control.
Menu>Format>Align
:confused:
Roght, but he wanted to do this via code. ;)
Where does it mention vba coding?Quote:
Originally Posted by VB4fun
Ecniv is correct, I was not trying to do it via coding.
I was trying to do it within Excel, when creating a form under a new Dialog1 sheet.
However, I expanded my project and have gone into the VBA IDE, and am now creating my form, etc. there....Inside the IDE you have the Format/Align which helps tremendously... The controls take a little more to set up, but it seems to be working none the less.
(And it is teaching me VBA, which I have wanted to learn for some time.)
Thanks for the help along the way!
And since he already is posting how its done in design mode, I put 1+1 together to make 2. :DQuote:
Is there a way to do this simply, in Excel VBA ?
No problem :) to both of you hehe
Can you set the thread to resolved please?