Hi @ all,
I use a macro for deleting a text between two brackets in a range("a1:a6000").
Dim c As Range
Dim p1 As Double
Dim p2 As Double
For Each c In Range("a1:a60")
p1 = InStr(c, "[")
p2 = InStr(c, "]")
If p1 > 0 Then c.Value = Left(c, p1 - 1) & Right(c, Len(c) - p2 - 0)
Next c
it works fine but only for the first pair of brackets:
something like "cars[ss,s,c]" becomes "cars"
but:
auto[o,au]mo[o,au]bi[i,ay,ai]le becomes automo[o,au]bi[i,ay,ai]le
how can I modify the code to delete all the text between all the bracket pairs in a cell ?
Many thanks in advance for any help!
Gr.Benni
Bookmarks