+ Reply to Thread
Results 1 to 8 of 8

What causes the application-based error?

Hybrid View

aloha31 What causes the... 08-05-2013, 06:58 PM
Richard Buttrey Re: What causes the... 08-05-2013, 07:06 PM
Norie Re: What causes the... 08-05-2013, 07:15 PM
aloha31 Re: What causes the... 08-05-2013, 07:33 PM
Norie Re: What causes the... 08-05-2013, 07:39 PM
aloha31 Re: What causes the... 08-05-2013, 08:22 PM
Richard Buttrey Re: What causes the... 08-06-2013, 04:17 AM
Norie Richard The code would... 08-06-2013, 05:41 AM
  1. #1
    Forum Contributor
    Join Date
    07-12-2013
    Location
    Los angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    109

    What causes the application-based error?

    Here is my line of code:
    Set totalrng = Worksheets("DO RSH and RSM").Range("B6", Range("P" & Rows.Count).End(xlUp))
    Can't see why this would need debugging?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: What causes the application-based error?

    What error message are you getting.

    Are you able to upload the workbook so that we can see the problem in context?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: What causes the application-based error?

    There's no worksheet reference for the Rangem inside the brackets.

    Try this.
    With  Worksheets("DO RSH and RSM")
        Set totalrng =.Range("B6", .Range("P" & Rows.Count).End(xlUp))
    End With
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    07-12-2013
    Location
    Los angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    109

    Re: What causes the application-based error?

      With Worksheets("DO RSH and RSM")
        Set totalrng = .Range("B6", Range("P" & Rows.Count).End(xlUp))
        End With
    This is still returning an error. Here's my workbook:RPI_Sheet_NEWregrange.xls

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

    Re: What causes the application-based error?

    That isn't the code I posted.

  6. #6
    Forum Contributor
    Join Date
    07-12-2013
    Location
    Los angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    109

    Re: What causes the application-based error?

    I left out a decimal point... *facepalm* Thanks for keeping me in line, Norie!

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: What causes the application-based error?

    Hi,

    I still can't see why your original code didn't work unless it was inside a WITH statement which wasn't mentioned in your original.

    It worked OK for me as a straightforward line of code on its own so I'm still intrigued as to the error you were getting.

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

    The code would fail if any worksheet other than 'DO RSH and RSM' was active.

    The reason for that is that Range("P" & Rows.Count).End(xlUp) refers to the active sheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Set Range Application-Based Error
    By aloha31 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-05-2013, 03:02 PM
  2. Why am I getting an application-based/object-based error?
    By aloha31 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-16-2013, 05:51 PM
  3. [SOLVED] Getting Error 1004 Object or Application Defined Error - Code to rearrange data
    By BlazzedTroll in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-10-2013, 12:10 PM
  4. error 1004 application defined error (Moving click button)
    By mdavid800 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-08-2011, 10:13 AM
  5. [SOLVED] run-time error '1004': Application-defined or object-deifined error
    By rich5665@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2005, 05:05 PM

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