+ Reply to Thread
Results 1 to 4 of 4

Help! Why am I getting Run-time error '1004': Method 'Range' of object'_Gloabl' Failed

  1. #1
    Registered User
    Join Date
    03-23-2011
    Location
    San Diego
    MS-Off Ver
    Excel 2003
    Posts
    15

    Help! Why am I getting Run-time error '1004': Method 'Range' of object'_Gloabl' Failed

    I have the following code that keeps giving me the error message " Run-time error '1004': Method 'Range' of object'_Gloabl' Failed"

    Can someone please help me.

    Code:

    Sub errorhandling()
    Worksheets("Sheet1").Select
    On Error GoTo E6:
    Range("SACC6").Cells(Range("SACC6").Rows.Count, 1).Offset(1, 0).Activate
    E6:
    On Error GoTo Err8:
    Range("SACC7").Cells(Range("SACC7").Rows.Count, 1).Activate
    Err8:
    End Sub
    Last edited by ExcelNewbeee; 03-21-2012 at 05:34 PM.

  2. #2
    Registered User
    Join Date
    02-27-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Help! Why am I getting Run-time error '1004': Method 'Range' of object'_Gloabl' Failed

    I'm not sure where you're code is bombing out without a sample of what you're working with but I'd start with checking your references. Does it actually begin on Sheet1 and so forth.

  3. #3
    Registered User
    Join Date
    03-23-2011
    Location
    San Diego
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Help! Why am I getting Run-time error '1004': Method 'Range' of object'_Gloabl' Failed

    Thanks Jluc,

    The code can be pasted in any workbook and ran and the error will appear.

    You can open up a new workbook and paste the code and run it. As long as you have a tab named "Sheet1", then the error will appear

  4. #4
    Registered User
    Join Date
    03-23-2011
    Location
    San Diego
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Help! Why am I getting Run-time error '1004': Method 'Range' of object'_Gloabl' Failed

    Figured it out! I could have used On Error Resume Next, but the example below allows the use of On Error Goto mulitple times within a single sub routine.

    Sub errorhandling()
    On Error GoTo E6:
    Worksheets("Sheet1").Select
    On Error GoTo E6:
    Range("SACC6").Cells(Range("SACC6").Rows.Count, 1).Offset(1, 0).Activate
    E6:
    Resume Check2
    Check2:

    On Error GoTo Err8:
    Range("SACC7").Cells(Range("SACC7").Rows.Count, 1).Offset(1, 0).Activate
    Err8:
    End Sub

+ 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