Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Is there a shortcut to align code in VBA?

I'm using the Excel VBA editor.

I've been trying for sometime to left align my code, but the Align menu is faded off.

When I select few lines of codes, go to Format -> Align -> lefts/Centers( This is faded off and I cannot select this at all)

Am I doing it the right way ?
Posted
Updated 20-Sep-12 4:35am
v2
Comments
[no name] 20-Sep-12 9:25am    
Knowing what editor you are using to write this code in would be a big help. My guess is that the Align feature you are trying to use for code is actually supposed to be used for controls on a form designer.
Sumal.V 20-Sep-12 9:28am    
I'm using Excel VBA, to code the macros.
There aren't any shortcuts available too..
Joan M 20-Sep-12 10:36am    
Never used that editor, in some other editors, you can press TAB and shift+tab to move entire text selections.
Sumal.V 20-Sep-12 10:43am    
Cheers, That works.
But it is different. For example, if its an If statement, every line is aligned to the left, spoiling the flow/look , but by explicitly pushing some lines to the right and then realigning to the left keeps the format right.
But thanks :)

P.S. Can you add this as a solution so that I can take this question off the unanswered list.
Thanks
Joan M 20-Sep-12 10:50am    
There it is. ;)

1 solution

Never used that editor, in some other editors, you can press TAB and SHIFT+TAB to move entire text selections.

Regards, :thumbsup:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900