+ Reply to Thread
Results 1 to 9 of 9

Clear contents on different sheets

  1. #1
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Clear contents on different sheets

    I have a code which clear several ranges on two sheets but it gives me attached error, can anyone suggests what,s the problem
    Please Login or Register  to view this content.
    error.PNG
    Last edited by Zahid0111; 03-28-2020 at 03:17 AM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Clear contents on different sheets

    For starters, you have multiple spelling errors in your code.
    "ClearContents" on the first line is fine, then "ClearContent" on the next two. Then finally, "ClearContetnts".

  3. #3
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Clear contents on different sheets

    Quote Originally Posted by Zahid0111 View Post
    I have a code which clear several ranges on two sheets but it gives me attached error, can anyone suggests what,s the problem
    Please Login or Register  to view this content.
    Attachment 669443
    Check Spell of ClearContents

  4. #4
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Clear contents on different sheets

    Ahh oops didnt saw that...well thank you Paul...

  5. #5
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Clear contents on different sheets

    Thank you ...Just made the correction..it,s working now...

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Clear contents on different sheets

    You're welcome. Also note that you can clear multiple ranges on the same worksheet in one line of code, e.g.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Clear contents on different sheets

    Thank you paul..this works great
    can you please help me with this: https://www.excelforum.com/excel-pro...ml#post5301562
    Last edited by Zahid0111; 03-28-2020 at 04:05 AM.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,811

    Re: Clear contents on different sheets

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  9. #9
    Forum Contributor
    Join Date
    08-10-2016
    Location
    Pakistan
    MS-Off Ver
    365
    Posts
    242

    Re: Clear contents on different sheets

    @alansidman Done...
    sorry just saw your message now... thank you

+ 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] Need to modify code to loop through these sheets and clear contents
    By g1terra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-31-2019, 01:18 AM
  2. [SOLVED] amend code to clear contents and format in vba except row 1 in specific sheets
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2018, 10:36 AM
  3. [SOLVED] assistance vba on clear contents on several sheets invalid next control variable referenc
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-23-2017, 03:39 PM
  4. I need to code to clear contents the several fixed ranges of several sheets
    By samahhamaad in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-03-2016, 05:21 PM
  5. Clear merged cell contents in comand button(clear all)
    By mohan_984 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-25-2015, 10:39 AM
  6. Code to clear contents of specific cells based upon if key exists in other sheets
    By seputus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 07:25 PM

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