+ Reply to Thread
Results 1 to 16 of 16

code multiple cells and clears the contents but get Method Range of object_ Global failed

  1. #1
    Forum Contributor
    Join Date
    04-30-2013
    Location
    McAllen TX
    MS-Off Ver
    Excel 2007
    Posts
    389

    code multiple cells and clears the contents but get Method Range of object_ Global failed

    hello all

    i have examined this code, that was working until i added a few more individual cells and range of cells as well as removed some cells after changing the sheet up a bit, but i cannot find the issue... i can send the wkbk if necessary but wondered if there is anything that pops out at any one that would be causing the code to fail.

    Please Login or Register  to view this content.
    note in my module the code is all on one line ; any help &/or suggestions is greatly appreciated as i am a novice at best.
    Last edited by dyoung785; 05-31-2019 at 11:08 AM. Reason: added txt to explinaion

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    The string you are passing to the range is too long, try
    Please Login or Register  to view this content.
    Which cells within that range are you trying to clear?

  3. #3
    Forum Contributor
    Join Date
    04-30-2013
    Location
    McAllen TX
    MS-Off Ver
    Excel 2007
    Posts
    389

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    all of those cells in the Range

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    In that case what is this line meant to be doing?
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-30-2013
    Location
    McAllen TX
    MS-Off Ver
    Excel 2007
    Posts
    389

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    As i said i am a novice but i believe that allows values to be cleared but leave formulas and maybe whether cell is locked or not... ?

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    Do you have any formulae in those cells?

  7. #7
    Forum Contributor
    Join Date
    04-30-2013
    Location
    McAllen TX
    MS-Off Ver
    Excel 2007
    Posts
    389
    Quote Originally Posted by Fluff13 View Post
    Do you have any formulae in those cells?
    I dont think i do, if i do i suppose i dont need to clear cells with formula, as i could just clear the cells that those formulas depend on. Wld like to know for future ref if this is possible that is to clear only the value and not the formula.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    Ok, Try this
    Please Login or Register  to view this content.
    This will leave any formulae intact.

  9. #9
    Forum Contributor
    Join Date
    04-30-2013
    Location
    McAllen TX
    MS-Off Ver
    Excel 2007
    Posts
    389
    Quote Originally Posted by Fluff13 View Post
    Ok, Try this
    Please Login or Register  to view this content.
    This will leave any formulae intact.
    Thank you!. Will be back in the office in a few and give it a try...

    Wondering what is the limit? That is allowed befor you haave to pass it to another "range line"

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    @dyoung785
    Are you and laidback785 the same person?

  11. #11
    Forum Contributor
    Join Date
    04-30-2013
    Location
    McAllen TX
    MS-Off Ver
    Excel 2007
    Posts
    389

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    Yes, was wondering why i couldnt find my post ...

  12. #12
    Forum Contributor
    Join Date
    04-30-2013
    Location
    McAllen TX
    MS-Off Ver
    Excel 2007
    Posts
    389

    Cool Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    and by the way, code worked great ... thank you very much !

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    You're welcome & thanks for the feedback

  14. #14
    Forum Contributor
    Join Date
    04-30-2013
    Location
    McAllen TX
    MS-Off Ver
    Excel 2007
    Posts
    389

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    wanted to mark this as solved but I don't remember how to do that...

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    It's under thread tools above the op

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: code multiple cells and clears the contents but get Method Range of object_ Global fai

    laidback/dyoung, please pick an ID and stick with that 1.

    Reply to my PM (to both ID's) and I will delete 1 of them for you.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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] Referring to columns by header in code, error 1004 method range of object global failed?
    By LIL2606 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-14-2019, 07:54 AM
  2. Runtime error 1004 Method 'Range' of object_ Global Failed
    By stevoDE in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-30-2017, 11:33 AM
  3. [SOLVED] Method Range of object Global failed
    By radddogg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2016, 10:30 AM
  4. Method `Range of object_'Worksheet' failed - Trying to write variable to cell
    By stevemcd1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2013, 04:52 PM
  5. [SOLVED] Method 'Range' of object_'Worksheet' failed
    By davidsonfm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2013, 11:09 AM
  6. Method 'Range' of object_ 'Global' Failed
    By naveenmarapaka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2012, 10:35 AM
  7. Method Range of object global failed
    By paddingtonstation in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2012, 07:33 AM

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