Banner

Friday, March 10, 2017

Transfer Duplicate Value With Count Numbers Excell VBA





Private Sub CommandButton1_Click()

a = Application.WorksheetFunction.CountIf(Sheet1.Range("A:A") _

, "*" & Me.TextBox1.Text & "*")

If a >= 1 Then

Sheet1.Range("A100000").End(xlUp).Offset(1, 0).Value = Me.TextBox1.Text & a

Sheet1.Range("A100000").End(xlUp).Offset(0, 1).Value = Me.TextBox2.Text

Else

Sheet1.Range("A100000").End(xlUp).Offset(1, 0).Value = Me.TextBox1.Text

Sheet1.Range("A100000").End(xlUp).Offset(0, 1).Value = Me.TextBox2.Text

End If

End Sub

No comments:

Post a Comment

Please do not enter any spam message in comment box