Closed Thread
Results 1 to 6 of 6

Compile Error: Expected End Sub

  1. #1
    Registered User
    Join Date
    02-13-2011
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2007
    Posts
    38

    Compile Error: Expected End Sub

    Hi,
    I tried the next code and I have the error: Compile Error: Expected End Sub
    Can anyone help me?
    Thank you

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Compile Error: Expected End Sub

    Remove BOTH End Function lines at the end of your SUB

    Subs and Functions are not the same. Your code is either one or the other" Sub()...End Sub or Function()....End Function
    Last edited by protonLeah; 02-27-2011 at 02:59 PM.
    Ben Van Johnson

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Compile Error: Expected End Sub

    hi, marianmix, the code should be:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Compile Error: Expected End Sub

    You can't use a function as you have posted it.
    You need in your module
    Please Login or Register  to view this content.
    Then call the function like this
    Please Login or Register  to view this content.

    This code, to me at least, seems a bit over complicated and specialised, and I am nearly certain it is not what you are looking for.

    I will ask once again.

    What are you trying to do?
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  5. #5
    Registered User
    Join Date
    02-13-2011
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: Compile Error: Expected End Sub

    Thank you for the answers!
    The source I got the code is http://www.ozgrid.com/forum/showthre...t=70185&page=1
    I want to split a paragraph without breaking the words.
    If you have an easy solution i will be glad to hear.
    The last code I used was
    http://www.excelforum.com/excel-2007...een-lines.html but it breaks the words.
    Last edited by marianmix; 02-27-2011 at 04:07 PM.

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

    Re: Compile Error: Expected End Sub

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    Hope that helps.

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

    Free DataBaseForm example

Closed 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