+ Reply to Thread
Results 1 to 6 of 6

Commenting out Rows in VB

  1. #1
    Registered User
    Join Date
    01-19-2005
    Posts
    27

    Commenting out Rows in VB

    If im not wrong there is a way to comment out a selection in VB with some key storke. what is that keystorke?

  2. #2
    Gord Dibben
    Guest

    Re: Commenting out Rows in VB

    Ordinary old apostrophe does the trick

    Sub text()
    ' this line will not be executed
    this line will be executed
    End Sub


    Gord Dibben MS Excel MVP

    On Fri, 20 Jan 2006 15:07:41 -0600, MC82
    <[email protected]> wrote:

    >
    >If im not wrong there is a way to comment out a selection in VB with
    >some key storke. what is that keystorke?



  3. #3
    Mark Lincoln
    Guest

    Re: Commenting out Rows in VB

    Anything after an apostrophe on a line is considered a comment.

    For instance:

    ' This is a comment

    A = B ' Comment starts here


  4. #4
    Registered User
    Join Date
    01-19-2005
    Posts
    27
    I thought there was a key stroke to comment out selected code.

    Ie. If I highlight rows 1-5, then press some keystroke. Rows 1-5 will automatically have a ' infront of it.

    I guess I might be wrong, but I could have sworn I saw a ex-coworker do it.

  5. #5
    Niek Otten
    Guest

    Re: Commenting out Rows in VB

    There is a button in the Edit toolbar (which of course you can include in
    your standard toolbar) that does just that

    --
    Kind regards,

    Niek Otten

    "MC82" <[email protected]> wrote in message
    news:[email protected]...
    >
    > I thought there was a key stroke to comment out selected code.
    >
    > Ie. If I highlight rows 1-5, then press some keystroke. Rows 1-5 will
    > automatically have a ' infront of it.
    >
    > I guess I might be wrong, but I could have sworn I saw a ex-coworker do
    > it.
    >
    >
    > --
    > MC82
    > ------------------------------------------------------------------------
    > MC82's Profile:
    > http://www.excelforum.com/member.php...o&userid=18682
    > View this thread: http://www.excelforum.com/showthread...hreadid=503505
    >




  6. #6
    Registered User
    Join Date
    01-19-2005
    Posts
    27
    Thanks thats exactly what I was looking for, just wished I could find out the keystroke, but that works for now. Thanks a bunch

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1