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.
Bookmarks