Results 1 to 5 of 5

Run-time error '1004': Method 'Range' of object '_ Global' failed

Threaded View

  1. #1
    Registered User
    Join Date
    10-20-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Run-time error '1004': Method 'Range' of object '_ Global' failed

    Hi,
    I am very new to VBA and am looking at a former colleague's worksheet. There is a macro in this worksheet which automatically creates 3 additional blank rows near the bottom of a spreadsheet.

    Unfortunately this macro does not seem to be working any more. I have copied the code for the macro below.

    Sub Insert_Row()
     
        Application.ScreenUpdating = False
        Application.DisplayAlerts = False
    
            Worksheets("Detailed").Select
            ActiveSheet.Unprotect Password:=PW
            Range("DetIR").Offset(-1, 0).EntireRow.Hidden = False
            Range("DetIR").Offset(-1, 0).EntireRow.Copy
            Range("DetIRRange").Insert Shift:=xlDown
            Range("DetIR").Offset(-1, 0).EntireRow.Hidden = True
            
            Worksheets("Summary").Select
            ActiveSheet.Unprotect Password:=PW
            Range("SumIR").Offset(-1, 0).EntireRow.Hidden = False
            Range("SumIR").Offset(-1, 0).EntireRow.Copy
            Range("SumIRRange").Insert Shift:=xlDown
            Range("SumIR").Offset(-1, 0).EntireRow.Hidden = True
            Range("A1").Select
            ActiveSheet.Protect Password:=PW
            
            Worksheets("Detailed").Select
            Range("A1").Select
            ActiveSheet.Protect Password:=PW
            
        Application.CutCopyMode = False
        
        Application.ScreenUpdating = True
        Application.DisplayAlerts = True
    
    
    
    End Sub

    The row that the debugger selects as causing the error is:

    Range("SumIR").Offset(-1, 0).EntireRow.Hidden = False
    Any help will be very gratefully received.

    Thanks
    Last edited by romperstomper; 10-20-2011 at 09:52 AM. Reason: putting in code tags

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