Experimente:
Dim rowcount As Long
Dim clt As Control
rowcount = Cells(Cells.Rows.Count, "A").End(xlUp).Row
If VBA.IsNumeric(Application.Match(Bcpf.Text, Sheets("plan1").Range("F1:f" & rowcount), 0)) Then
MsgBox "CPF já cadastrado dia - " & Cells(Application.Match(Bcpf.Text, Sheets("plan1").Range("F1:f" & rowcount), 0), "H")
Exit Sub
End If
With Worksheets("Plan1").Range("a3")
.Offset(rowcount, 0).Value = Me.Bnome.Value
.Offset(rowcount, 1).Value = Me.BSbrNome
.Offset(rowcount, 2).Value = Me.Bendr.Value
.Offset(rowcount, 3).Value = Me.Bcidade.Value
.Offset(rowcount, 4).Value = Me.Btel.Value
.Offset(rowcount, 5).Value = Me.Bcpf.Value
.Offset(rowcount, 6).Value = Me.Brg.Value
.Offset(rowcount, 7).Value = Format(Now, "dd/mm/yyyy")
End With
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 24/06/2014 1:02 pm