Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim Rng1 As Range
Dim Prompt As String
Dim Title As String
Dim Completed As Long
Dim Total As Long
Set Rng1 = Me.Range("A1:A50")
If Intersect(Target(1, 1), Rng1) Is Nothing Then
Exit Sub
End If
Cancel = True
On Error Resume Next
Prompt = "How many assignments have you completed?"
Title = "Completed Assignments"
Completed = InputBox(Prompt, Title)
Prompt = "How many total assignments do you have?"
Title = "Total Assignments"
Total = InputBox(Prompt, Title)
If Err <> 0 Then
On Error GoTo 0
Exit Sub
End If
On Error GoTo 0
Target(1, 1).NumberFormat = "@"
Target(1, 1).Value = Completed & " / " & Total
End Sub
|