ed.ayers315
Board Regular
- Joined
- Dec 14, 2009
- Messages
- 166
Hello,
I want to enter a number in these cells (c29, c35, c42, e29, e35, e42, g29, g35, g42, i29, i35, i43) after clicking out of that cell or pressing enter I want to perform the below calculations based on my choice in the dialog box.
I had this working in a userform using text box references. My user (trainee) said it was too confusing so I am trying to do it in the worksheet.
Any help will be appreciated! Thanks
Ed
I want to enter a number in these cells (c29, c35, c42, e29, e35, e42, g29, g35, g42, i29, i35, i43) after clicking out of that cell or pressing enter I want to perform the below calculations based on my choice in the dialog box.
I had this working in a userform using text box references. My user (trainee) said it was too confusing so I am trying to do it in the worksheet.
Any help will be appreciated! Thanks
Ed
HTML:
'Private Sub Worksheet_Change(ByVal Target As Range)''On Error Resume Next'''If Not Intersect(Selection(c29, e29, g29, g29, c35, e35, g35, i35, c42, e42, g42, i42), Target) Is Nothing Then'' Prompt = "1. This is your first choice" & vbLf & vbLf & "Press 1 for: Are you Titrating for ozs/Gal" & vbLf' Prompt = Prompt & "Press 2 for. Are you Titrating for %" & vbLf' UR7 = 0' While UR7 < 1 Or UR7 > 5' UserResp7 = InputBox(Prompt, "The Big Question")' UR7 = Val(UserResp7)' Wend' Select Case UR7' Case 1'' Do stuff for choice 1 here' c29.Value = Round(CDbl(TextBox117.Value) * 7812.5, 0) & " PPM"' c29.Value = Format(TextBox117.Value, "0.0 ozs/gal")' ActiveSheet.Unprotect' Range("$c$30").Select' Selection.NumberFormat = "General"' Selection.NumberFormat = "0.0"" ozs/gal"""' ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True' Case 2'''' Do stuff for choice 2 here' c29.Value = Round(CDbl(TextBox117.Value) * 10000, 0) & " PPM"' c29.Value = Format(TextBox117.Value / 100, "0.0 %")' ActiveSheet.Unprotect' Range("$c$30").Select' Selection.NumberFormat = "General"' Selection.NumberFormat = "0.0"" %"""' ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True' End Select'' On Error GoTo 0'' End If''End Sub