-
wait!
i just noticed it will add a space in the begining of each cell and osme other problems :-)
this should delete the problem with the space.
[vba]
Sub test()
txt = ActiveCell.Value
x = Split(txt, " ")
j = 0
For i = 0 To UBound(x)
If x(i) = "On" And x(i + 1) = "HOLD" Then
ActiveCell.Value = ""
While j < i
If j = 0 Then
ActiveCell.Value = x(j)
Else
ActiveCell.Value = ActiveCell.Value & " " & x(j)
End If
j = j + 1
Wend
i = UBound(x)
End If
Next i
End Sub
[/vba]
Last edited by Ago; 02-21-2008 at 04:36 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules