Results 1 to 8 of 8

Compile error: expected end of statement occurs when 'Handles' keyword is used

Threaded View

  1. #1
    Registered User
    Join Date
    11-13-2009
    Location
    Cumbria
    MS-Off Ver
    Excel 2016
    Posts
    87

    Compile error: expected end of statement occurs when 'Handles' keyword is used

    I'm sorry for asking what is probably a noob question, but I've just started learning VBA and don't understand why this happens. I'm trying to make a command button in a user form that initiates a sub routine when it is pressed, but when I start trying to code this subroutine using:

    Private Sub CommandButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CommandButton1.Click
    
    End Sub
    I get the error message; 'Compile error: expected end of statement occurs' with the word 'Handles' highlighted.

    Any help is much appreciated,

    Rowan
    Last edited by RowanB; 12-28-2011 at 04:26 PM.

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