osevero
10-13-2013, 12:17 AM
Hi again,
I have a database that receives data and nobody can change. To delete the data I use a macro where I write the number of the column ID and it deletes the row (can see the code below). And what I want it's when a row is removed, the ID numbers automatically readjust to always stay with the sequence 1,2,3,4,5,6,7,8... You can see this xlsx: 10696 Does anyone know how to do?
Private Sub CommandButton1_Click()
ThisWorkbook.Worksheets("Plan1").Activate
Range("B7").Select
While ActiveCell <> ""
If TextBox1.Text = ActiveCell Then
While ActiveCell = TextBox1.Text
ActiveCell.EntireRow.Delete
Wend
End If
ActiveCell.Offset(1, 0).Activate
Wend
End Sub
Cheers!
: pray2:
I have a database that receives data and nobody can change. To delete the data I use a macro where I write the number of the column ID and it deletes the row (can see the code below). And what I want it's when a row is removed, the ID numbers automatically readjust to always stay with the sequence 1,2,3,4,5,6,7,8... You can see this xlsx: 10696 Does anyone know how to do?
Private Sub CommandButton1_Click()
ThisWorkbook.Worksheets("Plan1").Activate
Range("B7").Select
While ActiveCell <> ""
If TextBox1.Text = ActiveCell Then
While ActiveCell = TextBox1.Text
ActiveCell.EntireRow.Delete
Wend
End If
ActiveCell.Offset(1, 0).Activate
Wend
End Sub
Cheers!
: pray2: