Question:
Answers:
I want to create a button which should populates data by given condition:
Suppose i have a table with 3 columns
Suppose i have a table with 3 columns
column1 column2 column3
a 3
b 4
b 3
a 4
b 4
the button should only show the data with the "b" value in column1
and "4" in column2. Also, it should put the value "yes" in column3, if
it satisfies the above condition.Answers:
Not sure if you want to delete the values in column 1 and column 2 if they are not b or 4.
Private Sub CommandButton1_Click() For i = 2 To 6 'Give the range as per your requirement If Cells(i, 1) = "b" And Cells(i, 2) = 4 Then Cells(i, 3).Value = "Yes" End If Next End Sub
Commentaires
Enregistrer un commentaire