I have the code below that deletes a row based on a textbox value in a userform.
i need to define the worksheet to = "PROJECTS" but somethings not right here:
lastrow = Worksheets("PROJECTS").UsedRange.Rows.Count
probably a simple fix but i'm stuck on it. any help is appreciated. Thanks!
Private Sub deletejob_Click()
Select Case MsgBox("ARE YOU SURE YOU WANT TO DELETE THIS PROJECT?", vbYesNo)
Case vbYes
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim lastrow As Long, r As Long
lastrow = Worksheets("PROJECTS").UsedRange.Rows.Count
For r = lastrow To 1 Step -1
If UCase(Cells(r, 3).Value) = jobno Then Rows(r).Delete
Next r
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Case vbNo
End Select
End Sub
Bookmarks