Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Block comments in VBA

Hello all,

Is there a way to do block comments in VBA instead of just the line comments (')?

--
Thanks for any help anyone can provide,

Conan Kelly


  #2   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Block comments in VBA

Not sure what you mean by a block comment, but if you want to label a code
section, you could comment a blank line above the code, then comment a blank
line after.

eg

'Comment here
Code starts here
-
-
-
-
-
Code ends here
'-----------

--
Ian
--
"Conan Kelly" <CTBarbarin at msn dot com wrote in message
...
Hello all,

Is there a way to do block comments in VBA instead of just the line
comments (')?

--
Thanks for any help anyone can provide,

Conan Kelly



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Block comments in VBA

Ian,

Thanks for the feed back.

What I mean by a block comment is in Transact-SQL (SQL Server 2000) and Java, a block comment starts with /* and ends with */.
Everything in between the start of the comment and the end of the comment is commented out, whether it consists of multiple lines or
just a couple of characters on one line. That way, when working with multiple lines, you don't have to comment out each line
individually. You just need to put a /* at the beginning of the lines you want commented out and put */ at the end.

Thanks again for all of your help,

Conan


"Ian" wrote in message ...
Not sure what you mean by a block comment, but if you want to label a code section, you could comment a blank line above the code,
then comment a blank line after.

eg

'Comment here
Code starts here
-
-
-
-
-
Code ends here
'-----------

--
Ian
--
"Conan Kelly" <CTBarbarin at msn dot com wrote in message ...
Hello all,

Is there a way to do block comments in VBA instead of just the line comments (')?

--
Thanks for any help anyone can provide,

Conan Kelly





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Block comments in VBA

Nope... Each line of comments must start with an apostrophe. C/C++ does not
care about carriage returns in the code so you can comment entire sections.
Here is what you can do. In the VBE bring up the edit tool bar and there are
two buttons on the bar "Comment Block" and "Uncomment Block". Select a group
of code and hit the button to automatically comment the entire section.
--
HTH...

Jim Thomlinson


"Conan Kelly" wrote:

Hello all,

Is there a way to do block comments in VBA instead of just the line comments (')?

--
Thanks for any help anyone can provide,

Conan Kelly



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Block comments in VBA

Jim,

Thanks for the feed back.

I already know about the Comment and Uncomment buttons on the toolbar. I use them quite regularly.

I was just hoping that VBA had a Start Comment character and an End Comment character, because they might be valuable in another
way. I would not use them to comment out multiple whole lines, but I think they might be useful to comment out sections of a single
line.

Thanks again for all of your help,

Conan Kelly




"Jim Thomlinson" wrote in message
...
Nope... Each line of comments must start with an apostrophe. C/C++ does not
care about carriage returns in the code so you can comment entire sections.
Here is what you can do. In the VBE bring up the edit tool bar and there are
two buttons on the bar "Comment Block" and "Uncomment Block". Select a group
of code and hit the button to automatically comment the entire section.
--
HTH...

Jim Thomlinson


"Conan Kelly" wrote:

Hello all,

Is there a way to do block comments in VBA instead of just the line comments (')?

--
Thanks for any help anyone can provide,

Conan Kelly







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Block comments in VBA

Sorry the languages you list (of which C/C++ is a part) are all freeform
languages. They don't care about carriage returns or comments. They care
about semi colons.
--
HTH...

Jim Thomlinson


"Conan Kelly" wrote:

Jim,

Thanks for the feed back.

I already know about the Comment and Uncomment buttons on the toolbar. I use them quite regularly.

I was just hoping that VBA had a Start Comment character and an End Comment character, because they might be valuable in another
way. I would not use them to comment out multiple whole lines, but I think they might be useful to comment out sections of a single
line.

Thanks again for all of your help,

Conan Kelly




"Jim Thomlinson" wrote in message
...
Nope... Each line of comments must start with an apostrophe. C/C++ does not
care about carriage returns in the code so you can comment entire sections.
Here is what you can do. In the VBE bring up the edit tool bar and there are
two buttons on the bar "Comment Block" and "Uncomment Block". Select a group
of code and hit the button to automatically comment the entire section.
--
HTH...

Jim Thomlinson


"Conan Kelly" wrote:

Hello all,

Is there a way to do block comments in VBA instead of just the line comments (')?

--
Thanks for any help anyone can provide,

Conan Kelly






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
excel 2000 how to format the comments font all comments Delquestion Excel Discussion (Misc queries) 1 October 8th 09 02:19 PM
End if without Block If Carrie_Loos via OfficeKB.com Excel Worksheet Functions 7 May 14th 08 06:47 PM
in excel useing comments how do you add clip art to comments? dhouse New Users to Excel 2 July 18th 07 08:14 AM
Block If DA@PD[_2_] Excel Programming 16 December 17th 05 01:57 AM
Shortcut way for indicating comments in block of code. Hari[_3_] Excel Programming 5 August 10th 04 01:49 AM


All times are GMT +1. The time now is 01:58 AM.

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"