View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Delete cells with 0 as the tenth digit

I think you will have to modify that pattern a little more... it seems to
kill off the internal newline character for this text...

12-30-08 SHIP 74A350834-2019 37
12-30-08 0 901-069-113-134 3
12-31-08 SHIP 70302-02159-120 83
12-31-08 0 901-069-114-174 4

or this text...

12-30-08 0 74A350834-2019 37
12-30-08 SHIP 901-069-113-134 3
12-31-08 0 70302-02159-120 83
12-31-08 SHIP 901-069-114-174 4

Also, might I suggest you use as different first argument name besides
Str... that is also the name of a built in VB function... and while it
causes no problem in your existing code, I think it is a good idea not use
it in it anyway.

--
Rick (MVP - Excel)


"Ron Rosenfeld" wrote in message
...
On Sun, 08 Feb 2009 23:26:32 -0500, Ron Rosenfeld

wrote:

=RegexSub(A1,"(\n|^).{9}0.*","")


Minor change in the formula:

=RegexSub(A1,"(\n|^).{9}0.*(\n|$)","")

(The UDF remains the same, but the pattern in the formula needed a small
change).

--ron