Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Sudhir_Gawade Sudhir_Gawade is offline
Junior Member
 
Posts: 3
Question Add 0 before decimal point through VBA

Hi,

In my MS Word document, there are about 50 pages. I need to add "0" where decimal value is in this format .25 or any Number. I need VBA code.

I have tried with below, but it is time consuming is there other way of doing same.

Sub a()

With ActiveDocument
For i = 1 To .Words.Count

If .Words(i).Text = "." Then

If IsNumeric(.Words(i).Text & .Words(i + 1).Text) And .Words(i - 1).Text "0" Then

.Words(i).Text = "0" & .Words(i).Text
i = i + 2
End If
End If
Next
End With

End Sub

Thanks in advance

Regards,
Sudhir.
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
align numbers by decimal point HAH Tables 2 May 23rd 07 09:02 PM
decimal point Terry Tables 5 January 30th 07 08:48 AM
Getting Decimal Point With Mail Merge Bethesda CPA Mailmerge 1 November 10th 06 04:40 AM
Decimal Point alignment notloiseweiss Tables 2 November 11th 05 08:43 PM
Change a decimal point (.) by coma (,) Thomas Mailmerge 4 February 17th 05 01:59 PM


All times are GMT +1. The time now is 05:55 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"