View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Marco - I need to trim/move the text from the beginning of eac

Just realized I left test syntax in the code.
This will work better.

Sub getCase()
For Each c In Range("A" & Cells(Rows.Count, 1).End(xlUp).Row)
If InStr(c.Value, "v") 0 Then
x = InStr(c.Value, "v") + 2
s = Right(c.Value, Len(Range("A2").Value) - x)
MsgBox s
End If
Next
End Sub

If any of the lines do not have a space after v. then it will clip the first
letter of the next word off. Be sure to edit for that.

"JLGWhiz" wrote:

You didn't say which column the data is in. This macro assumes it is in
column A.
You can modify accordingly.

Sub getCase()
Dim x As Long, s As Long, c As Range
For Each c In Range("A" & Cells(Rows.Count, 1).End(xlUp).Row)
If InStr(c.Value, "v") 0 Then
x = InStr(Range("A2"), "v") + 2
s = Right(Range("A2"), Len(Range("A2").Value) - x)
MsgBox s 'For test only, substitute cells posting code
End If
Next
End Sub






"suestew" wrote:

I need to cut everything up to and including "v." from each row. The first
row below should read "County of Suffolk, 2007 WL 4565160 (E.D.N.Y. Dec. 21,
2007)"

Toussie v. County of Suffolk, 2007 WL 4565160 (E.D.N.Y. Dec. 21, 2007)
TPS, Inc. v. United States Dept. of Defense, 330 F.3d 1191 (9th Cir. 2003)
Tracy v. Fin. Ins. Mgmt. Corp., 2005 WL 2100261 (S.D. Ind. Aug. 22, 2005)
Trammell v. Anderson Coll., 2006 WL 1997425 (D.S.C. July 17, 2006)

Any help?