+ Reply to Thread
Results 1 to 6 of 6

Why has my code stopped working?!

  1. #1
    Registered User
    Join Date
    04-30-2013
    Location
    Cranfield
    MS-Off Ver
    Excel 2007
    Posts
    68

    Why has my code stopped working?!

    Hi All,

    5 minutes ago, the following code gave a print preview of any area I selected on the worksheet but now I get a compile error.

    I'm pretty sure I didn't alter it but I have been working on other macros so does anyone have any ideas?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Why has my code stopped working?!

    what's the error message and on which line?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    04-30-2013
    Location
    Cranfield
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Why has my code stopped working?!

    Compile Error: Expected Function or variable

    On the Selection.PrintPreview line

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Why has my code stopped working?!

    have you created a routine or module called selection or printpreview?

  5. #5
    Registered User
    Join Date
    04-30-2013
    Location
    Cranfield
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Why has my code stopped working?!

    I don't think so. I just wanted to select a bunch of cells and then do a print preview on them...which is what this code did earlier.

    Is there any way of finding out and/or exiting from that module or routine at the beginning of this macro so it works properly?

  6. #6
    Registered User
    Join Date
    04-30-2013
    Location
    Cranfield
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: Why has my code stopped working?!

    I am such a doofus...my most recent macro is called Selection!
    Thank you for pointing me in the right direction.

+ 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