Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Nov 2003
    Location
    Bloomington, Minnesota, USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi-

    I need to sanitize $ (prices) in Word 2007 narrative. A word document containing pricing information is created from Excel. The document has both tables and narrative. We need to provide the same information in priced and unpriced format. The Excel people have figured out how to delete the columns containing prices, but there is still narrative in an over 500 page Word document . I need to figure out a better way than going through manually to delete the prices (or replace with 00s). The price format varies from things like $1K to things like $100,000 but at least everything has the $ sign. There are other numbers in the document (like quantities) that can't be changed.

    My VBA experience is limited to recording and tweaking other macros. I do not have much experience with the more complex search and replace options. It seems like search and replace should work, but I only can figure out how to replace the $ sign and one number, not multiple numbers.

    I'd appreciate any suggestions-- I'm running out of time. THANKS

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by CNM View Post
    I need to figure out a better way than going through manually to delete the prices (or replace with 00s). The price format varies from things like $1K to things like $100,000 but at least everything has the $ sign.
    You can use Word's wildcard search feature to find some of the matches. I say some, because it can be a bit tricky around the punctuation. You might have to perform several replaces.

    I briefly experimented with these:

    Find what$[0123456789]@)([.,][ ^13])
    Replace with: $PRICE\2

    Find what$[0123456789,]@)( )
    Replace with: $PRICE\2

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,947
    Thanks
    0
    Thanked 204 Times in 185 Posts
    At its simplest you could use '$[0-9,.K]{1,}' as the Find expression (without the quote characters), but there's always the risk you'll pick up amounts followed by periods and commas. As I see it, that's probably the best approach, choosing to replace or edit the amounts as you go.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #4
    New Lounger
    Join Date
    Nov 2003
    Location
    Bloomington, Minnesota, USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't know what I did wrong, but all samples didn't find anything that matched or said the search expression wasn't valid (the same issues I had when I was experimenting before). HOWEVER, you still helped me. In the process of trying to figure out whether I typed something wrong or didn't understand the various symbols, I saw <>. I hadn't thought of numbers as a word, but it works so far:


    Find What: $<*>
    Replace With: $PRICE (Highlight)

    I used highlighting to aid proofreading. I still need to do more testing, but so far the only thing not picked up was ,000 and that's easy enough to get out.

    Sigh of relief..... Thanks so much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •