Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ali ali is offline
external usenet poster
 
Posts: 1
Default Help modify simple existing code??

I've been using the following code to bring up 2 input boxes, 1 afte
the other, to allow the user to enter data into cells i'v
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 inpu
box to pop up with two fields, initials and date, instead of the two a
at present.

Can anyone help please? Many thank

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Help modify simple existing code??

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


Range("g3").Value = InputBox("Enter Your Initials in TWO letter format")
Range("h3") = date




--
Don Guillett
SalesAid Software

"ali" wrote in 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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Help modify simple existing code??

If you really want to use an InputBox, then you could ask the user to
separate the initials and todays date with a delimiter of some sort. eg
semi-colon.

If you think that at some point in the future you may be asking for more
than those two entries, you may want to create a userform.


"ali" wrote in 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/



  #4   Report Post  
Posted to microsoft.public.excel.programming
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/

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
ali ali is offline
external usenet poster
 
Posts: 1
Default Help modify simple existing code??

Thanks guys, an input box sounds like the way i want to go but i've
never created one of those before - would any of you be willing to
talk(type!) me through the way to create one with reference to what i
want to create - preferably explaining things in idiot proof english
along the way?

Once again your help is much appreciated


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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Help modify simple existing code??

Your OP said that "i am using the following code". I made a suggestion to
modify to suit your question. What is it you don't know how to do?

--
Don Guillett
SalesAid Software

"ali" wrote in message
...
Thanks guys, an input box sounds like the way i want to go but i've
never created one of those before - would any of you be willing to
talk(type!) me through the way to create one with reference to what i
want to create - preferably explaining things in idiot proof english
along the way?

Once again your help is much appreciated


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



  #7   Report Post  
Posted to microsoft.public.excel.programming
ali ali is offline
external usenet poster
 
Posts: 1
Default Help modify simple existing code??

Don,

Many apologies, i am clearly suffering from very tired eye syndrome and
messed up when i first tried your way. Thanks for taking the time to
help


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

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Help modify simple existing code??

glad to help. Get some sleep now. New years eve coming up.

--
Don Guillett
SalesAid Software

"ali" wrote in message
...
Don,

Many apologies, i am clearly suffering from very tired eye syndrome and
messed up when i first tried your way. Thanks for taking the time to
help


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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help!! To modify existing formula housinglad Excel Discussion (Misc queries) 2 February 11th 10 09:18 PM
Modify the existing formula wilchong via OfficeKB.com New Users to Excel 3 December 16th 08 11:02 AM
How do I delete or modify an existing drop down list? Jim Bradley Excel Discussion (Misc queries) 2 November 4th 08 05:40 PM
Modify an existing Cell formula using VBA Matt[_2_] Excel Discussion (Misc queries) 2 June 11th 07 08:50 PM
How do I modify an existing worksheet to remove columns & contents Gil Gray Excel Discussion (Misc queries) 1 February 10th 05 05:52 PM


All times are GMT +1. The time now is 04:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"