View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
StargateFan[_5_] StargateFan[_5_] is offline
external usenet poster
 
Posts: 10
Default User input into cell formula?

I have this script to ask user for a start date which works perfectly:
----------------------------------------------------------------------------------------------------------------------
Sub StartDate()

ActiveSheet.Unprotect 'place at the beginning of the code

Dim vResponse As Variant
Do
vResponse = Application.InputBox( _
Prompt:="Enter the start date for this sheet that
you need for the 2-week on, 2-week off, Par-A-Gon schedule:" & vbCrLf
& vbCrLf & _
"(Excel is flexible; you can pretty much type any
date format and it'll know what date you mean!)", _
Title:="Overtime Start Date", _
Default:=Format(Date, "mmm dd, yyyy"), _
Type:=2)
If vResponse = False Then Exit Sub 'User cancelled
Loop Until IsDate(vResponse)
Range("A2").Value = Format(CDate(vResponse), "mmm dd, yyyy")

ActiveSheet.Protect ' place at end of code
End Sub
----------------------------------------------------------------------------------------------------------------------

What user input box would ask for dosage that could then be dumped
into a protected cell with this custom format (to be dumped into
protected cell E1):

"''Dose'' = "@" tablets in a.m. & p.m."


Thank you!