Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Island Girl Island Girl is offline
external usenet poster
 
Posts: 192
Default Find and Replace

I'm working on a document which contains a table, one column of which has
dates in the mm/dd/yy format. However, several pages of the table contain,
for example, 6/25/07 instead of 06/25/07.

What find and replace entry would result in placing a zero in front of the
months with the inconsistent format? I've got a feeling this entry would use
the "but not" feature, which somehow still throws me for a loop.

What would I do without you?!


  #2   Report Post  
Posted to microsoft.public.word.newusers
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 285
Default Find and Replace

IG,

I suppose it could be done with find and replace, but an easy way doesn't
come to mind. Try running this macro with the table selected:

Sub ScratchMacro()
Dim oCell As Cell
For Each oCell In Selection.Tables(1).Range.Cells
If InStr(Left(oCell.Range.Text, 2), "/") Then
oCell.Range.InsertBefore "0"
End If
Next
End Sub


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Island Girl wrote:
I'm working on a document which contains a table, one column of which
has dates in the mm/dd/yy format. However, several pages of the
table contain, for example, 6/25/07 instead of 06/25/07.

What find and replace entry would result in placing a zero in front
of the months with the inconsistent format? I've got a feeling this
entry would use the "but not" feature, which somehow still throws me
for a loop.

What would I do without you?!



  #3   Report Post  
Posted to microsoft.public.word.newusers
Herb Tyson [MVP] Herb Tyson [MVP] is offline
external usenet poster
 
Posts: 2,936
Default Find and Replace

If the macro approach can't be used for some reason, The following
find/replace specification seems to work (this one assumes that all years
are 07; if they're all 0{something}, then replace 07 with 0[0-9]:

Find what: ([!0])([1-9]/[0-9][0-9]/07)

Replace with: \10\2

Make sure that Use wildcards is checked.

--
Herb Tyson MS MVP
http://www.herbtyson.com
Author of the Word 2007 Bible
Please respond in the newsgroups so everyone can follow along.
"Island Girl" wrote in message
...
I'm working on a document which contains a table, one column of which has
dates in the mm/dd/yy format. However, several pages of the table
contain,
for example, 6/25/07 instead of 06/25/07.

What find and replace entry would result in placing a zero in front of the
months with the inconsistent format? I've got a feeling this entry would
use
the "but not" feature, which somehow still throws me for a loop.

What would I do without you?!



  #4   Report Post  
Posted to microsoft.public.word.newusers
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 264
Default Find and Replace

Herb,

I tried that (or something close) before posting the macro. It won't
work, for me at least, if the date is first text element of the cell
range.

On Feb 27, 10:28 pm, "Herb Tyson [MVP]" wrote:
If the macro approach can't be used for some reason, The following
find/replace specification seems to work (this one assumes that all years
are 07; if they're all 0{something}, then replace 07 with 0[0-9]:

Find what: ([!0])([1-9]/[0-9][0-9]/07)

Replace with: \10\2

Make sure that Use wildcards is checked.

--
Herb Tyson MS MVPhttp://www.herbtyson.com
Author of the Word 2007 Bible
Please respond in the newsgroups so everyone can follow along."Island Girl" wrote in message

...



I'm working on a document which contains a table, one column of which has
dates in the mm/dd/yy format. However, several pages of the table
contain,
for example, 6/25/07 instead of 06/25/07.


What find and replace entry would result in placing a zero in front of the
months with the inconsistent format? I've got a feeling this entry would
use
the "but not" feature, which somehow still throws me for a loop.


What would I do without you?!- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.word.newusers
Island Girl Island Girl is offline
external usenet poster
 
Posts: 192
Default Find and Replace

Hi, Greg:

Thanks so very much for your quick reply with a solution to my problem. I
can't believe that I now have two solutions to a problem for which I was
beginning to think there was none! I read with glee both yours and Herb's,
which also worked for me.

Thanks for all you do, Greg!

"Greg Maxey" wrote:

IG,

I suppose it could be done with find and replace, but an easy way doesn't
come to mind. Try running this macro with the table selected:

Sub ScratchMacro()
Dim oCell As Cell
For Each oCell In Selection.Tables(1).Range.Cells
If InStr(Left(oCell.Range.Text, 2), "/") Then
oCell.Range.InsertBefore "0"
End If
Next
End Sub


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Island Girl wrote:
I'm working on a document which contains a table, one column of which
has dates in the mm/dd/yy format. However, several pages of the
table contain, for example, 6/25/07 instead of 06/25/07.

What find and replace entry would result in placing a zero in front
of the months with the inconsistent format? I've got a feeling this
entry would use the "but not" feature, which somehow still throws me
for a loop.

What would I do without you?!






  #6   Report Post  
Posted to microsoft.public.word.newusers
Island Girl Island Girl is offline
external usenet poster
 
Posts: 192
Default Find and Replace

Hi, Herb:

I really appreciate your answer to my perplexing problem. It worked for me
the very first time! Thanks to you and Greg, I now have two valuable
solutions to my problem.

Thanks again, Herb!

"Herb Tyson [MVP]" wrote:

If the macro approach can't be used for some reason, The following
find/replace specification seems to work (this one assumes that all years
are 07; if they're all 0{something}, then replace 07 with 0[0-9]:

Find what: ([!0])([1-9]/[0-9][0-9]/07)

Replace with: \10\2

Make sure that Use wildcards is checked.

--
Herb Tyson MS MVP
http://www.herbtyson.com
Author of the Word 2007 Bible
Please respond in the newsgroups so everyone can follow along.
"Island Girl" wrote in message
...
I'm working on a document which contains a table, one column of which has
dates in the mm/dd/yy format. However, several pages of the table
contain,
for example, 6/25/07 instead of 06/25/07.

What find and replace entry would result in placing a zero in front of the
months with the inconsistent format? I've got a feeling this entry would
use
the "but not" feature, which somehow still throws me for a loop.

What would I do without you?!




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
Find multiple characters in one find using MSword find/replace Cliff Microsoft Word Help 2 October 29th 06 07:48 PM
How to Find a 'Printing' Paragraph symbol using 'Find & Replace' A.N. Microsoft Word Help 3 July 3rd 06 03:07 AM
Trying to replace words with fields using Find/Replace mbleyle Microsoft Word Help 2 March 29th 06 11:35 PM
Using find and replace or macros to replace page ranges JeremyC Microsoft Word Help 7 February 13th 06 09:20 PM
Find/ Replace is auto-capping the words I want to replace with Graham Mayor Microsoft Word Help 8 January 27th 06 01:39 AM


All times are GMT +1. The time now is 08:30 PM.

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"