Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-05-2020, 08:43 AM
Ulodesk Ulodesk is offline Macro adjustment needed Windows 7 64bit Macro adjustment needed Office 2013
Word 2013 Expert Cert
Macro adjustment needed
 
Join Date: Sep 2009
Location: Virginia
Posts: 872
Ulodesk is on a distinguished road
Default Macro adjustment needed

The following macro replaces single blank paragraphs in a selection with a tab starting the following paragraph, but it tabs any second successive blank line returns rather than removing them, and does not tab the first paragraph selected. Also, it brings up the "would you like to continue searching the document" dialogue, which is unnecessary. I tried toying with the macro, but I don't know what I'm doing, so it didn't work.



I appreciate your help.

Code:
Sub ParasBlankToTabSelection()
'
' Replaces blank paragraphs with a tab starting following paragraph in selected text.
'
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^13^13"
        .Replacement.Text = "^p^t"
        .Forward = True
        .Wrap = wdFindAsk
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Reply With Quote
 

Tags
find/replace macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
IF Statement Adjustment shawn.low@cox.net Mail Merge 0 09-23-2019 10:08 AM
Macro adjustment needed Automatic adjustment date zbiku25 Project 3 02-28-2017 09:03 AM
Macro adjustment needed ***help*** macro needed PokerBob Excel 8 03-18-2015 02:57 PM
Macro adjustment needed Table adjustment on Surface OneNote TheMax OneNote 1 01-23-2015 04:33 PM
Macro Needed to bold specific lines and Macro to turn into CSV anewteacher Word VBA 1 05-28-2014 03:59 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:43 PM.


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