+ Reply to Thread
Results 1 to 6 of 6

Runtime Error 1004 Application-defined or Object-defined Error while selecting Range

  1. #1
    Registered User
    Join Date
    08-18-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    7

    Runtime Error 1004 Application-defined or Object-defined Error while selecting Range

    Hi,

    I've decided to try going another route from an earlier problem I had which I wasn't able to fix. What I'm trying to do now is clear the contents of all rows below the first blank cell in column A for all open workbooks and then do a little formatting. Here is the full code:

    Please Login or Register  to view this content.

    I get the aforementioned error on the line
    Please Login or Register  to view this content.
    If I remove
    Please Login or Register  to view this content.
    and have two workbooks open at the same time, it just runs the macro on the first workbook twice and doesn't touch the second workbook.

    If I remove

    Please Login or Register  to view this content.
    from the code and leave everything else the same then it properly bolds and underlines the correct cells in each sheet and works perfectly. So I know the problem must be somewhere in the above set of code (or maybe how it interacts with the Workbooks Collection object.) Also, I am running this code from PERSONAL.xlsb so I'm not sure if that makes a difference when referencing workbooks.

    Any ideas?

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

    Re: Runtime Error 1004 Application-defined or Object-defined Error while selecting Range

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

  3. #3
    Registered User
    Join Date
    08-18-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    7

    Re: Runtime Error 1004 Application-defined or Object-defined Error while selecting Range

    Hi, Norie!

    That code bolded and underlined the cells in both workbooks but didn't clear any contents.

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

    Re: Runtime Error 1004 Application-defined or Object-defined Error while selecting Range

    Does this work.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-18-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    7

    Re: Runtime Error 1004 Application-defined or Object-defined Error while selecting Range

    Same thing

  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: Runtime Error 1004 Application-defined or Object-defined Error while selecting Range

    Sorry, I'm not quite following what you want to do - probably me missing something.

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

+ 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. Runtime error 1004 application-defined or object-defined error
    By tymkiw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2014, 09:13 AM
  2. Runtime error 1004 - Application Defined or Object Defined error
    By andreroux in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-06-2013, 10:56 AM
  3. Replies: 0
    Last Post: 05-14-2012, 11:59 PM
  4. Runtime error 1004 application defined or object defined error
    By Wyliecody in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-03-2012, 12:38 PM
  5. Runtime error '1004' Application-defined or object-defined error Comment
    By Willer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2011, 03:02 PM
  6. RE: Runtime error 1004- application defined or object defined erro
    By Novice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2006, 05:40 PM
  7. [SOLVED] RE: Runtime error 1004- application defined or object defined erro
    By Jim Thomlinson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2006, 05:35 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