+ Reply to Thread
Results 1 to 2 of 2

Code suddenly stopped working

Hybrid View

bibleguy125 Code suddenly stopped working 02-14-2012, 02:44 PM
bibleguy125 Re: Code suddenly stopped... 02-15-2012, 01:00 PM
  1. #1
    Forum Contributor
    Join Date
    11-14-2009
    Location
    Midwest
    MS-Off Ver
    Excel 2003/2007
    Posts
    103

    Code suddenly stopped working

    I am trying to begin a macro that will do a lot of things, for now it will just copy paste a worksheet from an unopened workbook to be pasted into a new worksheet in the current workbook called Temp. I tried it once and it worked up until the point of copying the source worksheet, then stopped. I assumed it was stopped by me clicking on a dialog asking to update or not and tried disabling Alert Displays. Now absolutely nothing is happening when I choose something from the drop down. Anyone know what's going on?
    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
        Application.EnableEvents = False
        Application.ScreenUpdating = True
        Application.DisplayAlerts = True
        
        
        Dim x As Long
        Dim sourceSheet As Worksheet
        Dim destSheet As Worksheet
        Sheets.Add.Name = "Temp"
        
        Workbooks.Open Filename:="WBname.xls"
        Set sourceSheet = Worksheets("Dat")
        sourceSheet.Activate
        sourceSheet.Cells.Select
        Selection.Copy
    
        Workbooks("CurrentWB.xls").Activate
        Set destSheet = Worksheets("Temp")
        destSheet.Activate
        destSheet.Cells.Select
        destSheet.Paste
        
        Workbooks("WBname.xls").Close
        
    
    End Sub
    Last edited by bibleguy125; 02-14-2012 at 07:32 PM.

  2. #2
    Forum Contributor
    Join Date
    11-14-2009
    Location
    Midwest
    MS-Off Ver
    Excel 2003/2007
    Posts
    103

    Re: Code suddenly stopped working

    Nobody have any ideas?

+ 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