Re: Macro to eliminate mutiple blank lines. by Joost
Joost
Thu Jul 08 13:29:24 CDT 2004
Hahahaha, :D
Feel free to use it as you please!
Have fun ;-)
Joost Verdaasdonk
>-----Original Message-----
>Works perfectly. I gave you credit in the comments
incase
>I stick it in a userform later. So no need to sue :)
>
>
>>-----Original Message-----
>>Hi,
>>
>>You're welcom!
>>
>>Have Fun,
>>Joost
>>>-----Original Message-----
>>>Thank you so much I'll test it in a bit. I especially
>>>like .TypeBackspace
>>>
>>>>-----Original Message-----
>>>>
>>>>>-----Original Message-----
>>>>>Well the thing I did try, since I didn't have time
to
>>>>>code anything, usign the repalce command I put
>>>in "^l^l"
>>>>>in the find window, which is the code for manual
line
>>>>>break I believe, and I put in "^l" in teh replace
>with
>>>>>window. However becuase the characters are on
>>different
>>>>>lines, my theory anyway, it couldnt find two
>>>consecutive
>>>>>line breaks. Another theory of mine was that becuase
>>>the
>>>>>file I was working with was downloaded from a
>database
>>>>in
>>>>>a RTF format, perhaps it was a different kind of
line
>>>>>break, non-manual if such exists, so looking for a
>>>>manual
>>>>>line break might not be the way to go. So in any
case
>>>it
>>>>>didn't do anything, no replacements were made.
>>>>>
>>>>>I know I could code soemthign that goes line by line
>>>>>analyzin whats in the line and if its essentually
>>>>nothing
>>>>>it can record two consecutive events of nothing
found
>>>>and
>>>>>delete one line. But as I said I hardly have the
time
>>>at
>>>>>the moment for a side project.
>>>>>
>>>>>
>>>>>
>>>>>>-----Original Message-----
>>>>>>Hi,
>>>>>>what happened, when you tried to replace
consecutive
>>>>>>line breaks with one line break? How did you try?
>>>>>>What means "didn't really work"?
>>>>>>Did it work every now and then?
>>>>>>Could you give us some sample text and your code?
>>>>>>Greetings from Bavaria, Germany
>>>>>>Helmut Weber, MVP
>>>>>>"red.sys" & chr(64) & "t-online.de"
>>>>>>Word XP, Win 98
>>>>>>
>>>>>>.
>>>>>>
>>>>>.
>>>>>
>>>>
>>>>Hi,
>>>>
>>>>In a module:
>>>>
>>>>Option Explicit
>>>>
>>>>Public Function test() As Boolean
>>>> Dim x As Variant
>>>> Dim i As Integer
>>>>
>>>> With Selection
>>>> .HomeKey Unit:=wdStory
>>>>
>>>> For Each x In ActiveDocument.Paragraphs
>>>> If Len(x) = 1 And i = 1 Then
>>>> .TypeBackspace
>>>> ElseIf Len(x) = 1 Then
>>>> i = 1
>>>> Else
>>>> i = 0
>>>> End If
>>>> .MoveDown , 1
>>>> Next
>>>> End With
>>>>End Function
>>>>
>>>>Sub Enters()
>>>> Call test
>>>>End Sub
>>>>
>>>>Close the VBE en press ALT+F8
>>>>Run ENTERS
>>>>
>>>>Have Fun!
>>>>
>>>>Joost Verdaasdonk
>>>>The Netherlands
>>>>.
>>>>
>>>.
>>>
>>.
>>
>.
>