Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Shortcut way for indicating comments in block of code.

Hi,

Sometimes I dont want to execute a long piece of code, lets say 15 to 20
lines of code in one block but I would like to execute rest of the code.

I will have to enter the comment indicator at the beginning of each of those
lines. Rather than doing that is there a shortcut way for treating only that
particular block of code as comment?

Regards,
Hari
India


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Shortcut way for indicating comments in block of code.

Hi Hari

not sure if this is the easiest way but on the EDIT toolbar in VBA is an
icon to add the comment ' and one to remove it ... so select the block of
code, click on the add comment block icon (i always click 3 times to
distiguish between this & normal comments) and then when you want it to run
again, select it and click on the remove comment icon the appropriate number
of times.

Cheers
JulieD


"Hari" wrote in message
...
Hi,

Sometimes I dont want to execute a long piece of code, lets say 15 to 20
lines of code in one block but I would like to execute rest of the code.

I will have to enter the comment indicator at the beginning of each of

those
lines. Rather than doing that is there a shortcut way for treating only

that
particular block of code as comment?

Regards,
Hari
India




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Shortcut way for indicating comments in block of code.

"Hari" wrote in message
...
Sometimes I dont want to execute a long piece of code, lets say 15 to 20
lines of code in one block but I would like to execute rest of the code.

I will have to enter the comment indicator at the beginning of each of

those
lines. Rather than doing that is there a shortcut way for treating only

that
particular block of code as comment?


Hi Hari,

If you display the Edit toolbar in the Visual Basic Editor you will see
two toolbar buttons on it called "Comment Block" and "Uncomment Block". If
you highlight a block of code and click the Comment Block button, that whole
block of code will be commented out. When you want to run that block of code
again, highlight it and click the Uncomment Block button to remove the
comments.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Shortcut way for indicating comments in block of code.

Hi JulieD and Rob,

Thnx a lot for ur kind help.

(One doubt, the feature u indicated is there on my toolbar but Im not able
to find it in edit. I have excel 2002. Is this not part of menu in 2002.)

Regards,
Hari
India


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Shortcut way for indicating comments in block of code.

Hi Hari

no, its only on the Edit Toolbar (view / toolbars / edit) not on the menu
anywhere (AFAIK).

Cheers
JulieD

"Hari" wrote in message
...
Hi JulieD and Rob,

Thnx a lot for ur kind help.

(One doubt, the feature u indicated is there on my toolbar but Im not able
to find it in edit. I have excel 2002. Is this not part of menu in 2002.)

Regards,
Hari
India






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Shortcut way for indicating comments in block of code.

It's not on the Edit Menu, but you could customize your menu, and add it
(ToolsCustomize)

Hari wrote:
(One doubt, the feature u indicated is there on my toolbar but Im not able
to find it in edit. I have excel 2002. Is this not part of menu in 2002.)


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Block cracking code from opening protected excel sheets Barbara Excel Discussion (Misc queries) 5 March 31st 10 05:00 PM
vba code to block review toolbar Todd F Excel Programming 7 October 16th 06 12:23 AM
Help with shortcut key code will Excel Programming 2 May 18th 04 03:39 PM
Delete Shortcut with Code zSplash Excel Programming 9 April 10th 04 06:55 PM
Two Questions about the Following Block of Code Greener Excel Programming 0 October 9th 03 06:26 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"