View Single Post

September 17th, 2009, 11:02 PM
stanleydgromjr
Authorized User
 Points: 193, Level: 3
 Activity: 0%

Join Date: Nov 2007
Location: North East Pennsylvania, USA.
Posts: 48
Thanks: 0
Thanked 4 Times in 4 Posts

DoriftuEvo,

If your posted data is in column A, beginning in row 1 (before the macro):
2.00657892
3.10558234
[10.2345342]
[14.2560234]
4.13423105
5.14613461
4.23123451

2.23453253
[12.3452352]
[15.1624525]
[14.2145324]

After the macro:
2.00657892
3.10558234
10.2345342
14.2560234
4.13423105
5.14613461
4.23123451

2.23453253
12.3452352
15.1624525
14.2145324

Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

1. Copy the below macro, by highlighting the macro code and pressing the keys CTRL + C
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Paste the code by pressing the keys CTRL + V
7. Press the keys ALT + Q to exit the Editor, and return to Excel

Code:
```
Option Explicit
Sub RemoveSquareBrackets()
Dim c As Range
Application.ScreenUpdating = False
For Each c In Range("A1", Range("A" & Rows.Count).End(xlUp))
If Left(c, 1) = "[" Then c = Mid(c, 2, Len(c) - 1)
If Right(c, 1) = "]" Then c = Left(c, Len(c) - 1)
Next c
Application.ScreenUpdating = True
End Sub```

Then run the "RemoveSquareBrackets" macro.
__________________
stanleydgromjr

Windows 8.1, Excel 2007.