+ Reply to Thread
Results 1 to 8 of 8

Method 'Range' of object '_Global' failed

  1. #1
    Registered User
    Join Date
    08-01-2012
    Location
    United Kingdom
    MS-Off Ver
    Office 2010
    Posts
    71

    Method 'Range' of object '_Global' failed

    Hi

    I've made a macro to add a new absence to the bottom of a spreadsheet but I get the error code in the title at the line in bold. My code is

    Please Login or Register  to view this content.
    Any ideas? I've tried bypassing the New_EE_Id variables but it still doesn't work (it also makes it harder for anyone following me to look at it and understand it which makes me want to keep it in).

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Method 'Range' of object '_Global' failed

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Method 'Range' of object '_Global' failed

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-01-2012
    Location
    United Kingdom
    MS-Off Ver
    Office 2010
    Posts
    71

    Re: Method 'Range' of object '_Global' failed

    Thanks, but this highlights ".Rows" and says "Invalid or Unqualified reference", if I move the "End With" to the end of the sub then it says "Object variable or With block variable not set"

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Method 'Range' of object '_Global' failed

    Yes, that is right, but look at the full code I had amended.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Method 'Range' of object '_Global' failed

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    08-01-2012
    Location
    United Kingdom
    MS-Off Ver
    Office 2010
    Posts
    71

    Re: Method 'Range' of object '_Global' failed

    Quote Originally Posted by AB33 View Post
    Yes, that is right, but look at the full code I had amended.
    This gives LastRow + 1 = 11 (which is right) - I need New_EE_Id to go be cell A11.

  8. #8
    Registered User
    Join Date
    08-01-2012
    Location
    United Kingdom
    MS-Off Ver
    Office 2010
    Posts
    71

    Re: Method 'Range' of object '_Global' failed

    Quote Originally Posted by Norie View Post
    Try this.
    Please Login or Register  to view this content.
    Thanks, this is just what I need :D

+ 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