Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2025, 03:22 PM
macropod's Avatar
macropod macropod is offline Formatting dates only in Diary transcriptions Windows 10 Formatting dates only in Diary transcriptions Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by vivka View Post
Hi! Please, try this simple code:
FWIW, your
Code:
        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
could be reduced to:


Code:
        Do While .Execute
            myRng.Paragraphs.Last.Range.Font.Bold = True
            myRng.Paragraphs.Last.ange.Font.Size = 14
            myRng.Collapse wdCollapseEnd
        Loop
Not using a loop is more efficient, though. Regardless, you're not testing for full dates, so there's a risk of spurious matches (e.g. 'May I go now', 'The quick brown fox', 'She went home').
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 04-08-2025, 02:53 AM
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: 302
vivka is on a distinguished road
Default

Yes, Macropod, I fully agree! Thank you for your useful remarks!
Reply With Quote
Reply

Tags
formatting text, word vba

Thread Tools
Display Modes


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 06:29 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