+ Reply to Thread
Results 1 to 16 of 16

Reset button

  1. #1
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Reset button

    Hello

    Once i open my excel, its looks like this, as a new table
    1.png

    after working and adding rows and data it will be like this
    2.png

    can i have macro button for reset the table values and go back to first photo ?

    thanks

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Reset button

    Try this :
    Attached Images Attached Images

  3. #3
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Reset button

    not working brother

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Reset button

    Please explain what "not working" means.

    • Does the code run?
    • Does it run but do nothing?
    • Does it produce error messages? If so, what do the messages say?
    • Does it produce unexpected/wrong results? If so, how do the results differ from what you expect?
    • Does it hang?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Reset button

    after click the button, this error showing
    for this code
    rws = .Cells(.Rows.Count, "A").End(x1Up).Row

    Attachment 633173

  6. #6
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Reset button

    Don't think you copied/pasted the code. You have a 'one' in xlUp instead of an 'el'.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  7. #7
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Reset button

    i didnt understand what the problem but
    i write the code munally because u sent it as a photo, how can i copy the text

  8. #8
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Reset button

    Yep, you are right. Don't know why vorucha sent as a picture.

    Sounds like you didn't understand my comment. xlup (eks-el-you-pee) not x1up (eks-one-you-pee)
    Last edited by Pauleyb; 07-19-2019 at 11:26 AM.

  9. #9
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Reset button

    Quote Originally Posted by e97h View Post
    ... sent it as a photo, how can i copy the text
    Hi bro, You have also posted photos ...
    How did I "copy something as text" from photos for the trial code ?
    I have no OCR.

    Please Login or Register  to view this content.
    ... and you can change the whole macro to this code below, it will be "more flexible":
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Reset button

    Please Login or Register  to view this content.
    fantastic code , but there two problems ( its work only if i add more rows )
    1 - if i have same number of rows in the photo in first comment, noting happen even if its filled - it should clear contents -
    2 - also if i have less rows than the first photo, noting will happen even if filled - it should clear contents

    kindly add 2 if function in the code

    1 - if rws smaller than or equal 11, then remove the contents ( inside the table ) - i dont know if this possible or no, bcoz u dont where how the range will be
    2 - if rws =11 then clear contents range B2:L11

    thanks very much
    Last edited by Undo; 07-19-2019 at 12:52 PM.

  11. #11
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Reset button

    is my explain clear?, waiting for editing
    thanks

  12. #12
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Reset button

    Administrative Note:

    Please remember that those who help here do so voluntarily and of their own goodwill. They live in many different time zones and many will be out at work right now if they are not asleep on the other side of the globe. This is not a paid 'service': members will help when they are ready and able to do so, and not 'on demand'. Please do not try to put pressure of time on anyone here: if you get the help you need today, that's fine, but you really should not count on it. Thanks for your understanding and patience.

  13. #13
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Reset button

    @porucha
    Please update your profile as necessary to properly reflect the exact version(s) of Excel your question/answer relates to. Members tailor answers based on your Excel version. Your profile says "old" ??????

  14. #14
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Reset button

    @pepe
    noted,sorry

  15. #15
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Reset button

    Did you try his new code in #9?

  16. #16
    Forum Contributor
    Join Date
    07-14-2019
    Location
    Dubai
    MS-Off Ver
    2019
    Posts
    919

    Re: Reset button

    thanks.. 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. Create running stopwatch/timer with 1 button (start/stop). No reset button.
    By leeroy2612 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-26-2021, 12:59 AM
  2. Replies: 1
    Last Post: 05-18-2019, 10:31 AM
  3. Undo button from reset button
    By RJ1969 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-24-2019, 01:19 AM
  4. [SOLVED] I need to create a reset button that will reset rows containing a specific value
    By odin78 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 04-03-2016, 02:11 PM
  5. [SOLVED] Reset Button
    By Mick Hassell in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2015, 04:58 AM
  6. Reset Button
    By alvstar2001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2013, 06:03 AM
  7. Reset Button
    By Laker555 in forum Excel General
    Replies: 0
    Last Post: 08-01-2007, 12:33 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