+ Reply to Thread
Results 1 to 10 of 10

Runtime error 1004 - Application-defined or object-defined error

  1. #1
    Registered User
    Join Date
    10-13-2010
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    55

    Runtime error 1004 - Application-defined or object-defined error

    Hi,

    The following code was provided to me last night (thanks a bunch!!), but as I also need to identify which provider is responsible for the different sections that are listed, I have modified the sheets being copied to have the provider's name listed in column A for each row. When I changed the range to incorporate the changes I am now getting the following error:

    Runtime error 1004 - Application-defined or object-defined error.

    The line highlighted by the error is:
    Please Login or Register  to view this content.
    Another issue I have is the merged cells that are in the worksheets being copied. If I use the PasteValues option, I get an error that the merged cells must be the same size. I need to use paste values to pull the doctors name in as column A on the source worksheets has a formula to populate that.

    the code now reads: I have also attached a revised version of the example worksheet
    the code is listed in Module5
    Example Worksheet-3.xlsm

    Please Login or Register  to view this content.
    Any help is greatly appreciated

    Carole
    Last edited by Leith Ross; 04-14-2014 at 04:06 PM.

  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: Runtime error 1004 - Application-defined or object-defined error

    Hi,

    I don't experience the first problem you describe when manually stepping through and running the macro. Would you let us know exactly what steps youj are taking that causes the macro to crash.

    As for merged cells then my best advice is to avoid them like the plague. They really are far too much trouble than they are worth, causing many problems particularly in macros. Usually the simple formatting instruction 'Center across selection' achieves the same end.
    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
    Registered User
    Join Date
    10-13-2010
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Runtime error 1004 - Application-defined or object-defined error

    Hi, Thanks for replying. All I am doing is clicking the macro and immediately it gives me the error. As for the merge part if you look at the provider pages, the mergers are necessary due to the formatting of the top part of the form.

    Not sure what you mean by manually stepping through the macro.

    I am using Windows 8.1 now and Excel 2010.

    Any help would be greatfully appreciated.


    Carole
    Attached Images Attached Images

  4. #4
    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: Runtime error 1004 - Application-defined or object-defined error

    No, sorry I still don't encounter a problem when running the Billing_CopyIt macro.
    By stepping through it I merely meant running it one line of code at a time and watching for it to fall over - which it didn't.

    I too am using Excel 2010 and Windows 8.1

    I don't think the merged fields are absolutely necessary since you can achieve the same thing by using format centering across selection if required or indeed formatting left or right.

  5. #5
    Registered User
    Join Date
    10-13-2010
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Runtime error 1004 - Application-defined or object-defined error

    Hi,

    Thanks again for responding. I don't know what the difference is between what you are doing and I am, but I get the error every time I run the macro. I haven't tried stepping thru it (to be honest, not sure how to do that). I am not very good at writing code but ususally can understand what someone else has written and adapt it to what I need. The original code was provided to me in an earlier post -"Code to copy and paste not working".

    Any suggestions of how I can troubleshoot this would be appreciated.

    Carole

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

    Re: Runtime error 1004 - Application-defined or object-defined error

    I think you can only use (Select) "special cells" in a single column, but you have it in multi selection (A-J).
    Even if it works on multi selection, this line will error

    Please Login or Register  to view this content.
    If A is the first column, you can not go to the left of it.

    As to the merged cells, there is no way round, you need to unmerge cells first before you copy and paste them.

  7. #7
    Registered User
    Join Date
    10-13-2010
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Runtime error 1004 - Application-defined or object-defined error

    Hi again,

    I just found how to step through it. And it works until you get thru all the worksheets that are not to be used. It starts the Case Else section, but as soon as it gets to the Set rng = rng.Resize(rng.Rows.Count, rng.Columns.Count + 1).Offset(, -1) is when I get the error.

    Help!!!! thanks

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Runtime error 1004 - Application-defined or object-defined error

    Hello missit,

    If I understand this correctly then the attached workbook should do what you want. Check it out and let me know. The macro below has been added to Module7.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  9. #9
    Registered User
    Join Date
    10-13-2010
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Runtime error 1004 - Application-defined or object-defined error

    Hi,

    That works great. Now here is the hard part. I need to separate each of the groups that are copied and put the name of the provider above each group.

    So it would look something like this.

    Patient Acct. No. DOB Date of Service Provider Orig E/M Auditor E/M Billing Supports
    Dr X.
    V18376970 4/21/92 3/23/14 99283 99282 N
    V18376954 2/9/57 3/23/14 12001 12001 Y
    V18377069 8/6/12 3/23/14 99282, 69200 9282, 69200 Y
    V18377010 8/29/40 3/23/14 99282 99282 Y
    V18377168 10/4/41 3/23/14 99283 99283 Y
    Dr. Y
    Omarion T. Atchley 11/4/08 2/28/14 99202, 99383 99383 N

    etc.



    The provider's name is in cell C4 as well as the sheet name. I have been trying to figure this out for 3 days now and it has about eaten my lunch.

    Another part of the wish list is that there may be times that the other sections that are currently collapsed could have data in them as well that would need to be captured, but it is a wish list item at this point.

    If you can help me get the provider's name above each group, that would be tremendous.


    Thank you!!!!!

    Carole

  10. #10
    Registered User
    Join Date
    10-13-2010
    Location
    Colorado Springs, CO
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Runtime error 1004 - Application-defined or object-defined error

    Hi,

    I apologize. You did exactly what I asked for. Thanks you. it took me awhile to figure out what was going on.

    This is solved!!!!!!!

+ 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] Runtime error 1004 - Application Defined or Object Defined Error
    By ljuarez714 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2012, 05:25 PM
  2. Replies: 0
    Last Post: 05-14-2012, 11:59 PM
  3. 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
  4. 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
  5. [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