Currently I have a sub that deletes entire row. I just need to delete the range data in A:C (or A:E perhaps based on future processes). What would be the correct way to write the delete code? Code is below:
Private Sub cmdDelete_Click()
Dim Rw As Long
' Deletes items and values based on user defined selection through controls
' if deletion is made within middle of range, data is moved up
Rw = Me.ListBox1.ListIndex + 2
If Me.ListBox1.Text = "" Then
ElseIf MsgBox("You are about to delete " & txtFm.Text & _
" from the georeport! Any depths for geoprog and wellsite formation tables will be lost. If you need to update the top, click No and select Update. Do you wish to continue?", _
vbYesNo + vbDefaultButton2, "Delete Formation") = vbNo Then
Exit Sub
End If
If Me.ListBox1.ListIndex > -1 Then Sheets(msSHEET_NAME).Cells(Rw, 1).EntireRow.Delete
With ThisWorkbook.Sheets(msSHEET_NAME)
txtFm.Text = ""
txtMD.Text = ""
txtTVD.Text = ""
End With
FillListBox
End Sub
Bookmarks