?
Solved

VBA Macro to Prompt User for information

Posted on 2009-05-20
3
Medium Priority
?
970 Views
Last Modified: 2012-05-07
I want to prompt a user for a date entry, and then insert the date variable into the active Word document.  How can I set this up?  Do you have any examples I can reference?
0
Comment
Question by:cmp119
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
usachrisk1983 earned 1000 total points
ID: 24432346
Here is some VBA that will prompt for a date, validate it, and then enter it wherever the cursor is.

    sDate = InputBox("Please Enter a Date", "Date Prompt")
    
    If IsDate(sDate) Then
        Selection.TypeText (sDate)
    Else
        MsgBox "That's not a valid date!"
    End If

Open in new window

0
 
LVL 13

Assisted Solution

by:usachrisk1983
usachrisk1983 earned 1000 total points
ID: 24432355
If you're looking to replace text, insert text before after other text, etc, there are some great examples here:

http://support.microsoft.com/kb/212682
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question