MS Office 2010 - Word Macro


  1. Posts : 2
    Windows 7 Enterprise x64
       #1

    MS Office 2010 - Word Macro


    I am a novice at this and I have searched and searched over the last week trying to figure out a fix to this.

    I'm trying to create a Word Macro to remove time from date:

    This occurs in 4 different cells.

    Cell in Word shows: 05/04/2016 10:00:00

    I just need the date to show without the time.

    Looking for a code that will make this happen.

    Code that I have used for other issues looks something like this, however, the below example is what I'm trying to accomplish:
    ________________________________________________

    Sub TIME()
    '
    ' TIME Macro
    '

    With Selection.Find

    .ClearFormatting
    .Text = "??:??:??"
    .Replacement.ClearFormatting
    .Replacement.Text = ""
    .Execute Replace:=wdReplaceAll, Forward:=True, _
    Wrap:=wdFindContinue


    End With

    End Sub
    ________________________________________________

    Any help would be greatly appreciated!
    :)
      My Computer


  2. Posts : 9,746
    Windows 7 Home Premium 64 bit sp1
       #2

    Hi & welcome to the Forum.

    Instead of using a macro for adding the date you can use Alt+Shift+D instead.

    This website may also help you as well.

    How to Add the Date and Time to a Word 2010 Document - For Dummies
      My Computer


  3. Posts : 2
    Windows 7 Enterprise x64
    Thread Starter
       #3

    Hey,

    We have a form that we created that pulls 3 different dates, in which something has occurred.
    We created this form from a preconfigured XSD file.

    This XSD file is configured to pull data from a SQL Database.

    We need only the date to show up, not the time.

    So we trying to figure out a quick fix to this to only show the date.
      My Computer


  4. Posts : 9,746
    Windows 7 Home Premium 64 bit sp1
       #4

    Sorry, I can't help you with that.

    Perhaps someone else will drop & help.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 22:40.
Find Us