Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I change 6 digit field, cols 1 thru 6 to one (1) blank?

0 views
Skip to first unread message

Bentley_the_cat

unread,
Nov 29, 2009, 3:27:01 AM11/29/09
to
How do I change a 6 digit field in columns 1 thru 6 to one (1) blank or null?
It's an 80 character record with random 6 digit numbers in the first 6
positions that I need to delete and file is too big to do by hand.

Any Ideas?

thanks,
Bentley

Doug Robbins - Word MVP

unread,
Nov 29, 2009, 5:14:21 AM11/29/09
to
Assuming that each record is a separate paragraph, a macro containing the
following code will do it:

Dim i As Long
Dim frange As Range
With ActiveDocument
For i = 1 To .Paragraphs.Count
Set frange = .Paragraphs(i).Range
frange.End = frange.Start + 6
frange.Delete
Next i
End With

Or using a Wildcard replace with

^13[0-9]{6}

in the Find what control and

^p

in the replace with control will do what you want for all but the first
record in the document

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Bentley_the_cat" <Bentley...@discussions.microsoft.com> wrote in
message news:51FE61A7-A7E8-4CF9...@microsoft.com...

0 new messages