|
-
Aug 18th, 2005, 02:02 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Align Controls on a VBA Form
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 ?
Talk does not cook rice.
-Chinese Proverb
-
Aug 18th, 2005, 02:14 PM
#2
Re: Align Controls on a VBA Form
Nope, you need to code in each controls location.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 18th, 2005, 02:20 PM
#3
Thread Starter
Hyperactive Member
Re: Align Controls on a VBA Form
VB Code:
msgbox ("You have got to be kidding me"), vbExclamation
(thanks for the help anyway)
Talk does not cook rice.
-Chinese Proverb
-
Aug 18th, 2005, 02:51 PM
#4
Re: Align Controls on a VBA Form
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 18th, 2005, 02:59 PM
#5
Thread Starter
Hyperactive Member
Re: Align Controls on a VBA Form
needless to say, this could be time consuming with a fair amount of controls.
Talk does not cook rice.
-Chinese Proverb
-
Aug 19th, 2005, 04:17 AM
#6
Re: Align Controls on a VBA Form
Yeah you can in designer...
Use ctrl to select more than one control.
Menu>Format>Align
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Aug 19th, 2005, 07:12 AM
#7
Re: Align Controls on a VBA Form
Roght, but he wanted to do this via code.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 19th, 2005, 08:05 AM
#8
Re: Align Controls on a VBA Form
 Originally Posted by VB4fun
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 ?
Where does it mention vba coding?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Aug 19th, 2005, 08:12 AM
#9
Thread Starter
Hyperactive Member
Re: Align Controls on a VBA Form
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!
Talk does not cook rice.
-Chinese Proverb
-
Aug 19th, 2005, 08:13 AM
#10
Re: Align Controls on a VBA Form
Is there a way to do this simply, in Excel VBA ?
And since he already is posting how its done in design mode, I put 1+1 together to make 2.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 19th, 2005, 08:55 AM
#11
Re: Align Controls on a VBA Form
No problem to both of you hehe
Can you set the thread to resolved please?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|