+ Reply to Thread
Results 1 to 9 of 9

Macro Stops running after paste values

  1. #1
    Registered User
    Join Date
    01-09-2014
    Location
    Wrexham, Wales
    MS-Off Ver
    Excel 2010
    Posts
    6

    Post Macro Stops running after paste values

    Hi,

    Looking to see if anyone can offer any advice. I have macro that takes data from sheet and then pastes it onto a new sheet. It should then delete the data from the old sheet and hide that sheet. The problem I have is the macro stops after the paste special and does't complete the rest of the code.

    Does anyone know why this happening?

    Sub Dailytoweek()

    Sheets("Weekly Report").Visible = True
    Sheets("Process").Visible = True
    Sheets("Process").Select
    Rows("2:2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Sheets("Weekly Report").Select
    Range("A10000").Select
    Selection.End(xlUp).Offset(1, 0).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("Process").Select
    Rows("2:2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlUp
    Sheets("Process").Visible = False
    MsgBox "Completions Updated"

    End Sub

    Thanks for your help in advanced!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro Stops running after paste values

    I'm not sure what you problem was but try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    01-09-2014
    Location
    Wrexham, Wales
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro Stops running after paste values

    Thanks for your help,

    Just tried this and still having the same problem. As soon as the data has been pasted it stops.

    Really confused as I don't understand why.

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Macro Stops running after paste values

    Is there any code in the Weekly Report worksheet?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  5. #5
    Registered User
    Join Date
    01-09-2014
    Location
    Wrexham, Wales
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro Stops running after paste values

    There is,

    the code in the worksheet is:

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro Stops running after paste values

    Quote Originally Posted by mhawkins91 View Post
    Thanks for your help,

    Just tried this and still having the same problem. As soon as the data has been pasted it stops.

    Really confused as I don't understand why.
    Is either sheet protected?
    Do you have any merged cells on either sheet?
    Do you get an error message? If yes, what?

    EDIT: Ignore this
    Last edited by AlphaFrog; 01-12-2014 at 05:21 PM.

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Macro Stops running after paste values

    There is the problem - you must remove the:
    Please Login or Register  to view this content.
    line. (This should not be used by itself)

    You may also use
    Please Login or Register  to view this content.
    in the paste macro if you do not wish the Change event code to run - you must be sure to set this to True when the paste macro is finished.

  8. #8
    Registered User
    Join Date
    01-09-2014
    Location
    Wrexham, Wales
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro Stops running after paste values

    Quote Originally Posted by AlphaFrog View Post
    Is either sheet protected?
    Do you have any merged cells on either sheet?
    Do you get an error message? If yes, what?
    None of the sheets are protected, no merged cells and no error messages.

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro Stops running after paste values

    Replace END with Exit Sub. The END command stops all VBA code.

    Please Login or Register  to view this content.

+ 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. Macro running slowly, copy/paste values only from one workbook to another
    By Jeanette White in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-24-2012, 09:42 AM
  2. Macro leaves page where it stops running
    By Steve6386 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-14-2008, 02:38 PM
  3. Protection Stops Macro From Running
    By Keith Burgess in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-11-2008, 07:15 AM
  4. Excel VBA Macro stops running when another program is activated
    By Brody in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-23-2006, 02:45 PM
  5. [SOLVED] Macro stops running after file has moved
    By LWhite in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2005, 04:06 PM

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