ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   moving controls in X & Y axis (https://www.excelbanter.com/excel-programming/403173-moving-controls-x-y-axis.html)

Charlie

moving controls in X & Y axis
 
Is there a hotkey that you can use when moving a control on a userform that
will only allow X or Y axis movement, so if you've already aligned it up with
another control, you don't have to realign it again if you need to move it
closer?

JLGWhiz

moving controls in X & Y axis
 
For controls selected from the Control Toolbox, enter design mode, click the
control and use the arrow keys on the arrow keypad. For controls selected
from the Forms toolbar, right click the control and use the arrow keys on the
arrow keypad.
They move l, r, u and d.

"Charlie" wrote:

Is there a hotkey that you can use when moving a control on a userform that
will only allow X or Y axis movement, so if you've already aligned it up with
another control, you don't have to realign it again if you need to move it
closer?


Rick Rothstein \(MVP - VB\)

moving controls in X & Y axis
 
In the compiled version of VB, the IDE allows you to move controls using the
arrow keys coupled with the Ctrl key; however, it seem the IDE designers in
VBA did not implement that very useful key combination. The only way I could
find to do what you want is somewhat cumbersome to do and it assumes you
have your "Align Controls to Grid" option enabled. Let's say you want to
move you control horizontally... click on Tools/Options on the menu bar,
click the General tab and change the Grid Units Height to 60 (make sure
there is a check mark in the "Align Controls to Grid" CheckBox) and then
press OK. You will now be able to move your control left and right without
worrying about vertical movement. To move your control vertically instead of
horizontally, do the same as above except set the Grid Units Height to 60
instead.

Rick


"Charlie" wrote in message
...
Is there a hotkey that you can use when moving a control on a userform
that
will only allow X or Y axis movement, so if you've already aligned it up
with
another control, you don't have to realign it again if you need to move it
closer?



JLGWhiz

moving controls in X & Y axis
 
Just a footnote. You cannot make the adjustments while the code is running,
in case that was your question. The adjustments can only be made when there
is no procedure in process.

"Charlie" wrote:

Is there a hotkey that you can use when moving a control on a userform that
will only allow X or Y axis movement, so if you've already aligned it up with
another control, you don't have to realign it again if you need to move it
closer?


Charlie

moving controls in X & Y axis
 
hmmm, too bad, it is quite cumbersome, quicker just to move it freehand, and
realign with the other control...
thanks.


"Rick Rothstein (MVP - VB)" wrote:

In the compiled version of VB, the IDE allows you to move controls using the
arrow keys coupled with the Ctrl key; however, it seem the IDE designers in
VBA did not implement that very useful key combination. The only way I could
find to do what you want is somewhat cumbersome to do and it assumes you
have your "Align Controls to Grid" option enabled. Let's say you want to
move you control horizontally... click on Tools/Options on the menu bar,
click the General tab and change the Grid Units Height to 60 (make sure
there is a check mark in the "Align Controls to Grid" CheckBox) and then
press OK. You will now be able to move your control left and right without
worrying about vertical movement. To move your control vertically instead of
horizontally, do the same as above except set the Grid Units Height to 60
instead.

Rick


"Charlie" wrote in message
...
Is there a hotkey that you can use when moving a control on a userform
that
will only allow X or Y axis movement, so if you've already aligned it up
with
another control, you don't have to realign it again if you need to move it
closer?




Rick Rothstein \(MVP - VB\)

moving controls in X & Y axis
 
I tried that and I can't get it to work on my system. I'm using XL2003 if
that matters.

Rick


"JLGWhiz" wrote in message
...
For controls selected from the Control Toolbox, enter design mode, click
the
control and use the arrow keys on the arrow keypad. For controls selected
from the Forms toolbar, right click the control and use the arrow keys on
the
arrow keypad.
They move l, r, u and d.

"Charlie" wrote:

Is there a hotkey that you can use when moving a control on a userform
that
will only allow X or Y axis movement, so if you've already aligned it up
with
another control, you don't have to realign it again if you need to move
it
closer?



Rick Rothstein \(MVP - VB\)

moving controls in X & Y axis
 
Yes, I did say it was cumbersome. <g

JLGWhiz posted a procedure that I can't get to work on my system; however,
you should give it a try in case it will work for you... if it works, it
would be very simple to use.

Rick


"Charlie" wrote in message
...
hmmm, too bad, it is quite cumbersome, quicker just to move it freehand,
and
realign with the other control...
thanks.


"Rick Rothstein (MVP - VB)" wrote:

In the compiled version of VB, the IDE allows you to move controls using
the
arrow keys coupled with the Ctrl key; however, it seem the IDE designers
in
VBA did not implement that very useful key combination. The only way I
could
find to do what you want is somewhat cumbersome to do and it assumes you
have your "Align Controls to Grid" option enabled. Let's say you want to
move you control horizontally... click on Tools/Options on the menu bar,
click the General tab and change the Grid Units Height to 60 (make sure
there is a check mark in the "Align Controls to Grid" CheckBox) and then
press OK. You will now be able to move your control left and right
without
worrying about vertical movement. To move your control vertically instead
of
horizontally, do the same as above except set the Grid Units Height to 60
instead.

Rick


"Charlie" wrote in message
...
Is there a hotkey that you can use when moving a control on a userform
that
will only allow X or Y axis movement, so if you've already aligned it
up
with
another control, you don't have to realign it again if you need to move
it
closer?





Andy Pope

moving controls in X & Y axis
 
Hi,

Check out Stephen Bullen's VBE Tools.
http://www.oaltd.co.uk/VBETools/Default.htm

Cheers
Andy

Charlie wrote:
hmmm, too bad, it is quite cumbersome, quicker just to move it freehand, and
realign with the other control...
thanks.


"Rick Rothstein (MVP - VB)" wrote:


In the compiled version of VB, the IDE allows you to move controls using the
arrow keys coupled with the Ctrl key; however, it seem the IDE designers in
VBA did not implement that very useful key combination. The only way I could
find to do what you want is somewhat cumbersome to do and it assumes you
have your "Align Controls to Grid" option enabled. Let's say you want to
move you control horizontally... click on Tools/Options on the menu bar,
click the General tab and change the Grid Units Height to 60 (make sure
there is a check mark in the "Align Controls to Grid" CheckBox) and then
press OK. You will now be able to move your control left and right without
worrying about vertical movement. To move your control vertically instead of
horizontally, do the same as above except set the Grid Units Height to 60
instead.

Rick


"Charlie" wrote in message
...

Is there a hotkey that you can use when moving a control on a userform
that
will only allow X or Y axis movement, so if you've already aligned it up
with
another control, you don't have to realign it again if you need to move it
closer?




JLGWhiz

moving controls in X & Y axis
 
You're right, Rick. I missed the "on UserForm" part of the OP post. The
arrow keys only work on a sheet. The alignment facility appears to be the
quickest way on a UserForm.

"Rick Rothstein (MVP - VB)" wrote:

I tried that and I can't get it to work on my system. I'm using XL2003 if
that matters.

Rick


"JLGWhiz" wrote in message
...
For controls selected from the Control Toolbox, enter design mode, click
the
control and use the arrow keys on the arrow keypad. For controls selected
from the Forms toolbar, right click the control and use the arrow keys on
the
arrow keypad.
They move l, r, u and d.

"Charlie" wrote:

Is there a hotkey that you can use when moving a control on a userform
that
will only allow X or Y axis movement, so if you've already aligned it up
with
another control, you don't have to realign it again if you need to move
it
closer?





All times are GMT +1. The time now is 02:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com