F
Francis Hookham
I use a macro in Word which among other things 'tidies up' double spaces and
places where there should not be a space or a comma - it also makes sure
there is a space or a comma where there should be one - here is part of it
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " ."
.Replacement.Text = "."
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " ,"
.Replacement.Text = ","
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "."
.Replacement.Text = ". "
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ","
.Replacement.Text = ", "
End With
Selection.Find.Execute Replace:=wdReplaceAll
The trouble is it puts a space after the comma of thousands and the period
of
decimals in 1, 000. 00 which should be 1,000.00
Can you help by showing me how to recognise a numeral as the second
character to the right of any commas and stops and, if there is, deleting
the intervening space
(I suppose there is a slight possibility that a sentence might start with a
numeral but I can live with that)
Thanks
Francis Hookham
places where there should not be a space or a comma - it also makes sure
there is a space or a comma where there should be one - here is part of it
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " ."
.Replacement.Text = "."
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " ,"
.Replacement.Text = ","
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "."
.Replacement.Text = ". "
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ","
.Replacement.Text = ", "
End With
Selection.Find.Execute Replace:=wdReplaceAll
The trouble is it puts a space after the comma of thousands and the period
of
decimals in 1, 000. 00 which should be 1,000.00
Can you help by showing me how to recognise a numeral as the second
character to the right of any commas and stops and, if there is, deleting
the intervening space
(I suppose there is a slight possibility that a sentence might start with a
numeral but I can live with that)
Thanks
Francis Hookham