Solved

VBA Macro to Prompt User for information

Posted on 2009-05-20
3
965 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 250 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 250 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

688 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