Hello,
I want to create a Macro that will remove all characters after the second bracket in my string contained in Column H in the Active Sheet. I want to use vba code because this code will be combined with another piece of code.
Here is an example of my data:
What the data looks like Before Macro is executed:
<table border="0" cellpadding="0" cellspacing="0" width="375"><colgroup><col style="mso-width-source:userset;mso-width-alt:3108;width:64pt" width="85"> <col style="mso-width-source:userset;mso-width-alt:10605;width:218pt" width="290"> </colgroup><tbody><tr style="height:12.75pt" height="17"> <td style="height:12.75pt;width:64pt" height="17" width="85">
</td> <td style="width:218pt" width="290">Column H</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 1</td> <td>Codes</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 2</td> <td>[0567J]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 3</td> <td>[0398AP]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 4</td> <td>[08905M];[081P];[081897V];[0837865L];[086Y]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 5</td> <td>[08780L];[08567A];[087A]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 6</td> <td>[1456Q]</td> </tr> </tbody></table>
After Macro is run the data will look like this:
<table border="0" cellpadding="0" cellspacing="0" width="375"><colgroup><col style="mso-width-source:userset;mso-width-alt:3108;width:64pt" width="85"> <col style="mso-width-source:userset;mso-width-alt:10605;width:218pt" width="290"> </colgroup><tbody><tr style="height:12.75pt" height="17"> <td style="height:12.75pt;width:64pt" height="17" width="85">
</td> <td style="width:218pt" width="290">Column H</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 1</td> <td>Codes</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 2</td> <td>[0567J]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 3</td> <td>[0398AP]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 4</td> <td>[08905M]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 5</td> <td>[08780L]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 6</td> <td>[1456Q]</td> </tr> </tbody></table>
I want to create a Macro that will remove all characters after the second bracket in my string contained in Column H in the Active Sheet. I want to use vba code because this code will be combined with another piece of code.
Here is an example of my data:
What the data looks like Before Macro is executed:
<table border="0" cellpadding="0" cellspacing="0" width="375"><colgroup><col style="mso-width-source:userset;mso-width-alt:3108;width:64pt" width="85"> <col style="mso-width-source:userset;mso-width-alt:10605;width:218pt" width="290"> </colgroup><tbody><tr style="height:12.75pt" height="17"> <td style="height:12.75pt;width:64pt" height="17" width="85">
</td> <td style="width:218pt" width="290">Column H</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 1</td> <td>Codes</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 2</td> <td>[0567J]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 3</td> <td>[0398AP]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 4</td> <td>[08905M];[081P];[081897V];[0837865L];[086Y]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 5</td> <td>[08780L];[08567A];[087A]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 6</td> <td>[1456Q]</td> </tr> </tbody></table>
After Macro is run the data will look like this:
<table border="0" cellpadding="0" cellspacing="0" width="375"><colgroup><col style="mso-width-source:userset;mso-width-alt:3108;width:64pt" width="85"> <col style="mso-width-source:userset;mso-width-alt:10605;width:218pt" width="290"> </colgroup><tbody><tr style="height:12.75pt" height="17"> <td style="height:12.75pt;width:64pt" height="17" width="85">
</td> <td style="width:218pt" width="290">Column H</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 1</td> <td>Codes</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 2</td> <td>[0567J]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 3</td> <td>[0398AP]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 4</td> <td>[08905M]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 5</td> <td>[08780L]</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Row 6</td> <td>[1456Q]</td> </tr> </tbody></table>