+ Reply to Thread
Results 1 to 6 of 6

compile error with selection.pastespecial code

  1. #1
    Forum Contributor
    Join Date
    08-04-2004
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    186

    compile error with selection.pastespecial code

    I had used this before but now i get an "expected function or variable error" with this line of code. I get error as soon as I run macro but i cannot see what is at fault

    Please Login or Register  to view this content.
    Whole macro here
    Please Login or Register  to view this content.
    Last edited by philaugust2004; 03-05-2017 at 02:06 PM. Reason: add tags

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: compile error with selection.pastespecial code

    Moderation removed. Code Tags are added.
    Last edited by Winon; 03-05-2017 at 02:21 PM.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,485

    Re: compile error with selection.pastespecial code

    Please use Code Tags

    Please Login or Register  to view this content.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    08-04-2004
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    186

    Re: compile error with selection.pastespecial code

    Thanks TMS.
    I still get a method end of object error on
    Please Login or Register  to view this content.
    Last edited by philaugust2004; 03-05-2017 at 02:53 PM.

  5. #5
    Forum Contributor
    Join Date
    08-04-2004
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    186

    Re: compile error with selection.pastespecial code

    My mistake.
    Sheet name had changed from Sheet1

    Thanks for the help

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,485

    Re: compile error with selection.pastespecial code

    You're welcome.


    Thanks for adding the Code Tags.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Compile Error upon selection
    By bralew in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-01-2016, 10:48 AM
  2. [SOLVED] code compile error
    By Burt_100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-09-2015, 03:43 AM
  3. [SOLVED] Compile Error VBA error code attached
    By cgibson92 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-01-2015, 11:07 AM
  4. code generating compile error: syntex error
    By sankarsasmal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2013, 05:29 AM
  5. [SOLVED] Compile Error in Hidden Module and Compile Error: Can't find project or library
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-10-2013, 07:03 PM
  6. [SOLVED] Intermittent Error 1004 on Selection.PasteSpecial
    By BeachRock in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 10-21-2012, 01:23 AM
  7. VB code - compile error box help!!!
    By excel.xls in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2007, 10:15 AM

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