View Single Post
 
Old 08-19-2019, 07:24 PM
Helend269 Helend269 is offline Windows 7 32bit Office 2003
Novice
 
Join Date: Aug 2017
Posts: 15
Helend269 is on a distinguished road
Default Inserting blank lines but only once no matter how many times code is run

I have lines of text and I want to use VBA to insert blank lines but only once, no matter how many times I run the code. So:


This is line one.
This is line two.



Becomes:
This is line one.


This is line two.





I have a find/replace that searches for".^p[A-Z]" and replaces it with ".^p^p[A-Z]". The [A-Z] is supposed to find any capital letter on the next line and replace it with the same capital letter.



If my find /replace is ".^p" / ".^p^p" then running it again will insert a blank line each time I run it. Having it look for a capital letter after the ".^p" will prevent that.


But when I run it nothing happens. Is what I want to do possible?




Thank you.
Reply With Quote