A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Microsoft Word Help
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

How do I search for pennies in Word (eg $4.13 as opposed to $4)



 
 
Thread Tools Display Modes
  #1  
Old November 18th 09, 03:37 PM posted to microsoft.public.word.docmanagement
guitarpants
external usenet poster
 
Posts: 1
Default How do I search for pennies in Word (eg $4.13 as opposed to $4)

I'm trying to find a fast way to search through financial statement footnotes
and find instances where monetary amounts are not rounded to nearest dollar.
For instance, where $151,252.11 is typed, there should only be $151,252 (no
pennies).
Is there a way to search for monetary amounts that end in pennies?
Ads
  #2  
Old November 18th 09, 05:21 PM posted to microsoft.public.word.docmanagement
Pesach Shelnitz[_2_]
external usenet poster
 
Posts: 277
Default How do I search for pennies in Word (eg $4.13 as opposed to $4)

Hi,

Do the following.
1. Press Ctrl+F to open Find and Replace.
2. In "Find What", type $[0-9,]{1,}.[0-9]{2}
3. Click "More".
4. Select the "Use wildcards" check box.
5. Click "Find Next.

Be sure to clear the "Use wildcards" check box when you perform your next
search.
--
Hope this helps,
Pesach Shelnitz


"guitarpants" wrote:

I'm trying to find a fast way to search through financial statement footnotes
and find instances where monetary amounts are not rounded to nearest dollar.
For instance, where $151,252.11 is typed, there should only be $151,252 (no
pennies).
Is there a way to search for monetary amounts that end in pennies?

  #3  
Old November 19th 09, 01:23 AM posted to microsoft.public.word.docmanagement
Greg Maxey
external usenet poster
 
Posts: 264
Default How do I search for pennies in Word (eg $4.13 as opposed to $4)

On Nov 18, 10:37*am, guitarpants
wrote:
I'm trying to find a fast way to search through financial statement footnotes
and find instances where monetary amounts are not rounded to nearest dollar.
For instance, where $151,252.11 is typed, there should only be $151,252 (no
pennies).
Is there a way to search for monetary amounts that end in pennies?


Pesach has shown you how to find the values. If you want to automate
the process, the following macro will find each instance and round the
value up or down (=.50 rounds up):

Public Sub FindAndRoundMonetaryValues()
Dim rngStory As Word.Range
Dim pFindTxt As String
Dim pReplaceTxt As String
Dim lngJunk As Long
Dim oShp As Shape
pFindTxt = "$[0-9,]{1,}.[0-9]{2}"
'Fix the skipped blank Header/Footer problem
lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype
'Iterate through all story types in the current document
For Each rngStory In ActiveDocument.StoryRanges
'Iterate through all linked stories
Do
SrcAndRplInSty rngStory, pFindTxt
On Error Resume Next
Select Case rngStory.StoryType
Case 6, 7, 8, 9, 10, 11
If rngStory.ShapeRange.Count 0 Then
For Each oShp In rngStory.ShapeRange
If oShp.TextFrame.HasText Then
SrcAndRplInSty oShp.TextFrame.TextRange, pFindTxt
End If
Next
End If
Case Else
'Do Nothing
End Select
On Error GoTo 0
'Get next linked story (if any)
Set rngStory = rngStory.NextStoryRange
Loop Until rngStory Is Nothing
Next
End Sub

Public Sub SrcAndRplInSty(ByVal rngStory As Word.Range, _
ByVal strSearch As String)
With rngStory.Find
.Text = strSearch
.MatchWildcards = True
While .Execute
rngStory.Text = "$" & Format(rngStory.Text, "#,000")
rngStory.Collapse Direction:=wdCollapseEnd
Wend
End With
End Sub

For help installing and using the macro see: http://www.gmayor.com/installing_macro.htm
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Separate formatting for lines as opposed to paragraphs Lhynard Microsoft Word Help 2 August 25th 09 05:31 PM
Separate formatting for lines as opposed to paragraphs Lhynard Page Layout 2 August 25th 09 05:31 PM
Sentence Case as opposed to ALL CAPS on TOC Xavier Microsoft Word Help 5 May 3rd 08 03:33 AM
Saving word documents in word format as opposed to wordpad Druless Microsoft Word Help 3 September 16th 05 10:08 PM
howto search for a word in more than one *.doc (search in all doc's in a folder)? erik Microsoft Word Help 2 February 11th 05 03:02 PM


All times are GMT +1. The time now is 10:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright 2004-2022 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.