Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-07-2017, 10:20 AM
rakesh seebaruth rakesh seebaruth is offline underline  date Windows 10 underline  date Office 2010 64bit
Novice
underline  date
 
Join Date: Jul 2017
Posts: 2
rakesh seebaruth is on a distinguished road
Default underline date

hi guys



i have the following vba codes which converts dates to dd.mm.yyyy

Sub GetDateAndReplace()
Dim FoundOne As Boolean

Selection.HomeKey Unit:=wdStory, Extend:=wdMove
FoundOne = True ' loop at least once

Do While FoundOne ' loop until no date is found
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "([0-9]{1,2})[/]([0-9]{1,2})[/]([0-9]{4})"
.Format = True
.Forward = True
.MatchWildcards = True
End With

Selection.Find.Execute Replace:=wdReplaceNone

' check the find to be sure it's a date
If IsDate(Selection.Text) Then
Selection.Text = Format(Selection.Text, "dd.mm.yyyy")
Selection.Collapse wdCollapseEnd
Else ' not a date - end loop
FoundOne = False
End If
Loop

End Sub

i want vba to underline the dates which have been converted to dd.mm.yyyy

thanks/regards

rakesh
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
underline  date Wriggly red underline kirkm Word 3 09-18-2016 07:50 PM
underline  date Hyperlinks: Removing Underline reRanger Word 2 08-04-2016 02:29 AM
underline  date Underline a tab Futsal1st Word 2 10-25-2015 05:31 PM
underline  date Underline at bottom of page won't go away yachts66 Word 3 08-13-2014 07:28 AM
underline  date Hyperlink - delete underline Savana PowerPoint 5 04-13-2011 12:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft