Results 1 to 19 of 19

I need to create a reset button that will reset rows containing a specific value

Threaded View

odin78 I need to create a reset... 04-02-2016, 07:47 PM
zico8 Re: I need to create a reset... 04-02-2016, 11:25 PM
odin78 Re: I need to create a reset... 04-03-2016, 12:28 AM
jaslake Re: I need to create a reset... 04-03-2016, 12:54 AM
odin78 Re: I need to create a reset... 04-03-2016, 01:24 AM
odin78 Re: I need to create a reset... 04-03-2016, 12:22 PM
jaslake Re: I need to create a reset... 04-03-2016, 01:05 PM
odin78 Re: I need to create a reset... 04-03-2016, 01:19 PM
jaslake Re: I need to create a reset... 04-03-2016, 01:37 PM
odin78 Re: I need to create a reset... 04-03-2016, 01:56 PM
jaslake Re: I need to create a reset... 04-03-2016, 01:58 PM
odin78 Re: I need to create a reset... 04-03-2016, 01:51 PM
jaslake Re: I need to create a reset... 04-03-2016, 01:54 PM
shg Re: I need to create a reset... 04-03-2016, 01:58 PM
jaslake Re: I need to create a reset... 04-03-2016, 01:59 PM
odin78 Re: I need to create a reset... 04-03-2016, 02:08 PM
jaslake Re: I need to create a reset... 04-03-2016, 02:11 PM
odin78 Re: I need to create a reset... 04-03-2016, 02:06 PM
shg Re: I need to create a reset... 04-03-2016, 02:07 PM
  1. #6
    Registered User
    Join Date
    04-02-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    MS Office 2013
    Posts
    19

    Re: I need to create a reset button that will reset rows containing a specific value

    I really need help with this guys... let me explain in a better way...

    This code does exactly what I want:

    Private Sub CommandButton1_Click()
    
    If Range("F21").Value = "Hospedado" Then
    Range("F21", "X21").Value = ""
    End If
    
    End Sub
    
    That's only for the first row F. I have another 150 rows that need the same coding. So this works as well:

    Private Sub CommandButton1_Click()
    
    If Range("F21").Value = "Hospedado" Then
    Range("F21", "X21").Value = ""
    End If
    
    If Range("F22").Value = "Hospedado" Then
    Range("F22", "X22").Value = ""
    End If
    
    If Range("F23").Value = "Hospedado" Then
    Range("F23", "X23").Value = ""
    End If
    
    End Sub
    
    
    And so on... if I continue with this code 150 times down I have solved my problem, however, there must be a simpler way to do it? I've tried this and it does NOT work...
    
    Private Sub CommandButton1_Click()
    
    If Range("F21":"F170").Value = "Hospedado" Then
    Range("F21", "X170").Value = ""
    End If
    
    End Sub
    
    Any ideas?

    Thanks and regards,
    Andreas B.
    Last edited by odin78; 04-03-2016 at 02:04 PM.

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. [SOLVED] Reset Button
    By Mick Hassell in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2015, 04:58 AM
  3. [SOLVED] Double click a cell to copy it to another cell & how to create a reset button in excel
    By jjin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-02-2013, 10:10 AM
  4. Reset Button
    By BJbeans in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-13-2012, 02:26 PM
  5. Create a clear/reset "button"?
    By splenguin in forum Excel General
    Replies: 10
    Last Post: 09-03-2009, 06:12 PM
  6. Reset Button
    By Laker555 in forum Excel General
    Replies: 1
    Last Post: 08-02-2007, 07:05 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