A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

In VBA, how do you format selected code all at once?



 
 
Thread Tools Display Modes
  #1  
Old July 28th, 2008, 01:25 AM posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel
LunaMoon
external usenet poster
 
Posts: 54
Default In VBA, how do you format selected code all at once?

Hi all,

In VBA, (the VBA inside Excel 2003), how do I do the following by key
short-cuts?

1. Auto-Format selected codes;
2. Comment/Uncomment selected codes...

Thank you!
  #2  
Old July 28th, 2008, 01:50 AM posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel
Rick Rothstein \(MVP - VB\)[_1004_]
external usenet poster
 
Posts: 1
Default In VBA, how do you format selected code all at once?

I'm not sure what you mean by your first question, but I can answer your
second one... I don't think there is a keyboard shortcut available. However,
you can add two buttons to the toolbar to make the task doable with a single
mouse click. Click View/Toolbars/Customize from the VB editor's menu bar,
click the Commands tab on the dialog box that appears, select Edit from the
Categories list and then scroll down until you find "Comment Block" and
"Uncomment Block" in the Commands list. Click, drag and drop each one of
them onto the menu bar. You can now Close the Customize dialog box. To use
the buttons, highlight several lines of code and click the "Comment Block"
icon and those line will turn into comments. Highlight any comment lines and
click the "Uncomment Block" icon and those lines will become normal
statements.

Rick


"LunaMoon" wrote in message
...
Hi all,

In VBA, (the VBA inside Excel 2003), how do I do the following by key
short-cuts?

1. Auto-Format selected codes;
2. Comment/Uncomment selected codes...

Thank you!


  #3  
Old July 28th, 2008, 02:16 AM posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel
Gary Keramidas
external usenet poster
 
Posts: 118
Default In VBA, how do you format selected code all at once?

you can use smart indenter to format the code.
http://www.oaltd.co.uk/Indenter/Default.htm

--


Gary


"LunaMoon" wrote in message
...
Hi all,

In VBA, (the VBA inside Excel 2003), how do I do the following by key
short-cuts?

1. Auto-Format selected codes;
2. Comment/Uncomment selected codes...

Thank you!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:10 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.