Results 1 to 9 of 9

Getting Error 1004, can't get it to stop

Threaded View

LightHeart7 Getting Error 1004, can't get... 01-30-2015, 04:36 PM
Arkadi Re: Getting Error 1004, can't... 01-30-2015, 04:51 PM
LightHeart7 Re: Getting Error 1004, can't... 01-30-2015, 05:56 PM
Trebor76 Re: Getting Error 1004, can't... 01-30-2015, 07:36 PM
LightHeart7 Re: Getting Error 1004, can't... 02-02-2015, 12:11 PM
LightHeart7 Re: Getting Error 1004, can't... 02-03-2015, 11:28 AM
romperstomper Re: Getting Error 1004, can't... 02-03-2015, 12:48 PM
LightHeart7 Re: Getting Error 1004, can't... 02-03-2015, 01:07 PM
romperstomper Re: Getting Error 1004, can't... 02-04-2015, 02:30 AM
  1. #1
    Registered User
    Join Date
    09-24-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    70

    Getting Error 1004, can't get it to stop

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.DisplayAlerts = False
        Dim wsNew As Worksheet, s As Worksheet
        If Target.Cells.Count > 1 Then Exit Sub
    
       On Error Resume Next
     
        If Not Intersect(Target, Range("A2:A600")) Is Nothing Then
            'Set wsNew = Sheets(Target.Offset(0, 1).Text & "_" & Target.Offset(0, 2).Text)
            If wsNew Is Nothing Then
    
    
        Worksheets("Temp").Copy After:=Worksheets(Worksheets.Count)
        
        
        Worksheets(Worksheets.Count).Name = Target.Offset(0, 1).Text & "_" & Target.Offset(0, 2).Text
     Err.Clear
        
        
    'ErrorHandler:
    If Err = 1004 Then
       
    For Each s In ActiveWorkbook.Sheets
        If Right(s.Name, 5) = "(*" Then
            s.Delete
        End If
    Next s
    End If
      
        Exit Sub
        End If
        End If
        
    End Sub
    I want to be able have it only warn me there is already a sheet with that name but not copy the original with the (#). I have about 24 of these now. Temp (#).
    Last edited by LightHeart7; 02-03-2015 at 01:07 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PasteSpecial causing RunTime error 1004 & autofill doesn't stop at last line
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-24-2014, 09:18 AM
  2. Macros stop to work when work sheet is protected. Run time error 1004
    By sellim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2012, 01:14 AM
  3. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  4. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  5. "File listings stop unexpectedly - error 1004".
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2011, 05:45 AM

Tags for this Thread

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