Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2019, 05:00 AM
Alphonse Alphonse is offline Macro - Press enter when a period is detected Windows 10 Macro - Press enter when a period is detected Office 2016
Novice
Macro - Press enter when a period is detected
 
Join Date: Jul 2019
Posts: 2
Alphonse is on a distinguished road
Default Macro - Press enter when a period is detected

Dear all,



I would like to make a macro that automaticaly press enter every time a period is detected in the text.

Example:

As-is

Fuerat aestu carentem habentia spectent tonitrua mutastis locavit liberioris. Sinistra possedit litora ut nabataeaque. Setucant coepyterunt perveniunt animal! Concordi aurea nabataeaque seductaque constaque cepit sublime flexi nullus. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident.


to be:

Fuerat aestu carentem habentia spectent tonitrua mutastis locavit liberioris.

Sinistra possedit litora ut nabataeaque.

Setucant coepyterunt perveniunt animal! Concordi aurea nabataeaque seductaque constaque cepit sublime flexi nullus.

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident.

and after edition, I would like to reformat the text as per the original (still using a macro).


Fuerat aestu carentem habentia spectent tonitrua mutastis locavit liberioris. Sinistra possedit litora ut nabataeaque. Setucant coepyterunt perveniunt animal! Concordi aurea nabataeaque seductaque constaque cepit sublime flexi nullus. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident.


Thank you!
Alphonse

Last edited by Alphonse; 07-16-2019 at 05:18 AM. Reason: typo
Reply With Quote
  #2  
Old 07-16-2019, 08:44 AM
gmaxey gmaxey is offline Macro - Press enter when a period is detected Windows 10 Macro - Press enter when a period is detected Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Macros don't press enter.

With a macro, you can change ". " to a period followed by a paragraph:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range 'or select the text to process and change to Selection.Range
  With oRng.Find
    .Text = ". "
    While .Execute
      oRng.Text = "." & vbCr
      oRng.Collapse wdCollapseEnd
    Wend
  End With
lbl_Exit:
  Exit Sub
End Sub

Now, if after doing that, you want to put it back like it was then what is the point of doing anything in the first place?
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 07-17-2019, 02:51 AM
Alphonse Alphonse is offline Macro - Press enter when a period is detected Windows 10 Macro - Press enter when a period is detected Office 2016
Novice
Macro - Press enter when a period is detected
 
Join Date: Jul 2019
Posts: 2
Alphonse is on a distinguished road
Default

Hello Craig,


Thanks a lot for you Macro.


I actually want to read more comfortably the text, do some modification and after, bringing back to the original format (this is for translation purpose).


Can you help me with that?



Kind regards,
Alphonse.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
when press enter, cell value rolls to zero Drywit44 Excel 1 11-21-2018 12:10 AM
Error in macro "Ambiguous name detected" - but why?? Officer_Bierschnitt Excel Programming 7 11-30-2015 03:55 AM
Macro - Press enter when a period is detected Macro Needed to Replace a Period by a Comma rsrasc Word VBA 2 08-23-2015 03:23 PM
text box appears after I press enter/try to write in bullet form topgunitsme Word 1 08-13-2014 03:26 PM
Highlighted text won't delete - when I press enter Gague Word 2 07-09-2010 12:53 PM

Other Forums: Access Forums

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