Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2023, 02:56 AM
Shelley Lou Shelley Lou is offline VBA insert period after manual numbering Windows 10 VBA insert period after manual numbering Office 2016
Competent Performer
VBA insert period after manual numbering
 
Join Date: Dec 2020
Posts: 171
Shelley Lou is on a distinguished road
Default VBA insert period after manual numbering

When converting pdfs to word, more often than not the manual numbering that will become Heading 1 is often missing the full stop/period and because it is missing, I can't run my auto numbering macro. I'm trying to find a way to insert a period for manual numbers that do not already contain a period e.g. 1, 2, 10, 100 but not for 1.1, 1.1.1, 1.1.1.1 – I've tried many ways to do a find and replace but nothing seems to be working – can anyone help at all – many thanks

add period to manual number.docx
Reply With Quote
  #2  
Old 03-05-2023, 03:45 AM
Shelley Lou Shelley Lou is offline VBA insert period after manual numbering Windows 10 VBA insert period after manual numbering Office 2016
Competent Performer
VBA insert period after manual numbering
 
Join Date: Dec 2020
Posts: 171
Shelley Lou is on a distinguished road
Default VBA insert period after manual numbering

So I think I've figured out the find and replace finally.

Capture.JPG

Code:
Sub AddFullStop()
    Application.ScreenUpdating = False
Selection.HomeKey Unit:=wdStory
With Selection.Find
  .ClearFormatting
  .Forward = True
  .Wrap = wdFindContinue
  .Format = True
  .MatchWildcards = True
  .Replacement.ClearFormatting
  .text = "(^13)([0-9]@)([ ^t])"
  .Replacement.text = "\1\2.\3"
  .Execute Replace:=wdReplaceAll
    End With
  Application.ScreenUpdating = True
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA insert period after manual numbering VBA Remove manual numbering after Outline numbering Shelley Lou Word VBA 2 08-04-2021 12:24 AM
VBA insert period after manual numbering VBA converting manual numbering to auto numbering Shelley Lou Word VBA 8 05-28-2021 01:08 AM
page numbering for manual Bursal Word 1 07-29-2018 02:08 PM
Insert manual page breaks Crowdie Word 5 07-31-2015 07:36 AM
VBA insert period after manual numbering Insert a period between cells? nikknock Word Tables 1 10-16-2014 02:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:53 AM.


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