kwebihaf,
Sample raw data:
Excel 2007
| A | B | C | D |
---|
TBU/EVE/234 | | | | |
TBU/EVE/111 | | | | |
TBU/EVE/222 | | | | |
EVE/TBU/1000 | | | | |
| | | | |
<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]4[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
Sheet1
After the macro:
Excel 2007
| A | B | C | D |
---|
TBU/EVE/234 | TBU/EVE/235 | TBU/EVE/236 | TBU/EVE/237 | |
TBU/EVE/111 | TBU/EVE/112 | TBU/EVE/113 | TBU/EVE/114 | |
TBU/EVE/222 | TBU/EVE/223 | TBU/EVE/224 | TBU/EVE/225 | |
EVE/TBU/1000 | EVE/TBU/1001 | EVE/TBU/1002 | EVE/TBU/1003 | |
| | | | |
<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
Sheet1
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 code
2. Open your NEW workbook
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. Where the cursor is flashing, paste the code
7. Press the keys
ALT +
Q to exit the Editor, and return to Excel
8. To run the macro from Excel press
ALT +
F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Code:
Option Explicit
Sub CalculateStrings()
' hiker95, 09/18/2013
' http://www.mrexcel.com/forum/excel-questions/727229-calculation-strings.html#post3578407
Dim c As Range, s, d As Long
Application.ScreenUpdating = False
For Each c In Range("A1", Range("A" & Rows.Count).End(xlUp))
s = Split(c, "/")
For d = 1 To 3 Step 1
c.Offset(, d) = s(0) & "/" & s(1) & "/" & s(2) + d
Next d
Next c
Columns.AutoFit
Application.ScreenUpdating = True
End Sub
Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension
.xlsm
Then run the
CalculateStrings macro.