Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-07-2025, 12:46 PM
vivka vivka is offline Formatting dates only in Diary transcriptions Windows 7 64bit Formatting dates only in Diary transcriptions Office 2016
Expert
 
Join Date: Jul 2023
Posts: 294
vivka is on a distinguished road
Default

Hi! Please, try this simple code:
Code:
Sub Format_If()
'Format as needed all paras that are preceded by an empty para and start with Mon, Tue, Wed, Thu, Fri, Sat, Sun plus space.
Dim myRng As range
    Application.ScreenUpdating = False
    Set myRng = ActiveDocument.range
    With myRng.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .text = "^13^13[FMSTW][aehoru][deintu] "
        .Replacement.text = ""
        .Forward = True
        .Wrap = wdFindStop
        .MatchWildcards = True
        Do While .Execute
            myRng.start = myRng.start + 2
            myRng.Paragraphs(1).range.Font.Bold = True
            myRng.Paragraphs(1).range.Font.Size = 14
            myRng.Collapse wdCollapseEnd
        Loop
    End With
    Application.ScreenUpdating = False
    Set myRng = Nothing
End Sub
Reply With Quote
 

Tags
formatting text, word vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Diary template RobinClay Word 0 05-05-2023 03:22 PM
Formatting th at the end of ordinal dates DBlomgren Publisher 0 01-23-2016 09:44 AM
Conditional Formatting Dates Phil H Excel 6 12-08-2014 07:42 AM
Formatting dates only in Diary transcriptions Conditional Formatting Dates jake.harris5253 Excel 1 12-06-2014 10:59 AM
Conditional Formatting with Dates namedujour Excel 1 02-21-2013 03:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:30 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