#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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? |
#3
|
|||
|
|||
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. |
|
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 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 |