View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
losmac[_2_] losmac[_2_] is offline
external usenet poster
 
Posts: 44
Default Help modify simple existing code??


Create your custom Input form. Insert 2 textboxes and 2
labels and 2 buttons (OK, CANCEL).
Label1.Caption = "Enter Your Initials"
TextBox1.Text = ""
Label2.Caption = "Enter Today's Date"
TextBox2.Text = Format(Date,"mmmm, dd yyyy")

Private Sub CmdOK_Click()

If Me.TextBox1 = "" Or Me.TextBox2 = "" Then
MsgBox "I need all data", vbExclamation, "Info..."
Exit Sub
End if

With ThisWorkbook.Worksheets("Name")
.Range("g3").Value = Me.TextBox1
.Range("h3").Value = Me.TextBox2
End with

Unload Me

End Sub

Private Sub CmdCancel_Click()
Unload Me
End Sub


-----Original Message-----
I've been using the following code to bring up 2 input

boxes, 1 after
the other, to allow the user to enter data into cells i've
pre-determined.

Range("g3").Value = InputBox("Enter Your Initials")
Range("h3").Value = InputBox("Enter Today's Date")


However, in an ideal world (or an ideal forum!) I'd like

only one input
box to pop up with two fields, initials and date, instead

of the two as
at present.

Can anyone help please? Many thanks


---
Message posted from http://www.ExcelForum.com/

.