Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
guitarpants guitarpants is offline
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?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Pesach Shelnitz[_2_] Pesach Shelnitz[_2_] is offline
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   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
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
Reply
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
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 03:06 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"