+ Reply to Thread
Results 1 to 4 of 4

Compile Error: Expected End Sub

  1. #1
    Registered User
    Join Date
    08-31-2011
    Location
    Indianapolis
    MS-Off Ver
    Excel 2010
    Posts
    2

    Compile Error: Expected End Sub

    Trying to create macro the will search to match data on an entry tab with data on a tab called data. When I find a match, I want the contents of E25 to be posted to column O in the corresponding line on the data tab.

    I keep getting the compile error. I originally called the macro option1. A friend helped with the code and he has it as worksheet_change. Can't seem to get it changed and working.

    Thanks for your help.

    Dcauth
    Please Login or Register  to view this content.
    Last edited by Dcauth; 08-31-2011 at 02:44 PM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Compile Error: Expected End Sub

    You need to remove the first few lines:

    Please Login or Register  to view this content.

    Please use code tags when posting code per the forum rules.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    08-31-2011
    Location
    Indianapolis
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Compile Error: Expected End Sub

    I will try this again.

    Trying to create macro the will search to match data on an entry tab with data on a tab called data. When I find a match, I want the contents of E25 to be posted to column O in the corresponding line on the data tab.

    I keep getting the compile error. I originally called the macro option1. A friend helped with the code and he has it as worksheet_change. Can't seem to get it changed and working.

    Thanks for your help.

    Dcauth
    Code:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Compile Error: Expected End Sub

    You've got a sub with the Private Sub Worksheet_Change event in it. You need to delete one of them

    Please Login or Register  to view this content.
    Last edited by shg; 08-31-2011 at 02:05 PM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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