+ Reply to Thread
Results 1 to 4 of 4

Method 'Range' of objects'_worksheet' failed

  1. #1
    Registered User
    Join Date
    12-08-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    37

    Method 'Range' of objects'_worksheet' failed

    Hi All

    Was wondering if anyone knows why I would be getting this error (Method 'Range' of objects'_worksheet' failed) when I try and run this code?
    The code works fine on the first sheet (Sheet1) but not on any of the remaining sheets (Sheet7 - Sheet 13)

    Please Login or Register  to view this content.
    Last edited by grantastley; 01-29-2013 at 04:31 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645
    With code like this you need a worksheet reference for Cells as well as Range.
    Please Login or Register  to view this content.
    Here's a couple of ways you can do that.
    Please Login or Register  to view this content.
    You'll need to add a worksheet reference for Cells wherever you have code like this.
    Last edited by Norie; 01-29-2013 at 03:24 AM.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Method 'Range' of objects'_worksheet' failed

    You need to qualify each Cells object.

    i.e
    Please Login or Register  to view this content.
    Otherwise, it assumes ActiveSheet.Cells....

  4. #4
    Registered User
    Join Date
    12-08-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Method 'Range' of objects'_worksheet' failed

    Thanx guys works like a treat now

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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