duteberta
Board Regular
- Joined
- Jun 14, 2009
- Messages
- 89
- Office Version
- 365
- Platform
- MacOS
This DELETE ROW sub below is working but I want to add the condition that it is to only delete the row when a "1" value in the first table column (called data[x]). How do I syntax this to the code?
VBA Code:
Sub DeleteRow()
Dim question As String
Dim rowNumber As Long
rowNumber = ActiveCell.Row
question = "Are you sure" & "?"
If MsgBox(question, vbOKCancel + vbCritical + vbDefaultButton2, "DELETE RECORD") = vbOK Then
Rows(rowNumber).EntireRow.Delete
Else
Exit Sub
End If
End Sub