Daniyielle
New Member
- Joined
- Jan 29, 2012
- Messages
- 3
Hello,
I have to export data from a pdf invoice in order to re-rate calls that billed incorrectly; however, in order to do so, I had to essentially create a macro similar to text to columns to move the data from one cell across multiple cells. So far, I have the macro working like I want, but I am stuck when it comes to the city and state (this is imperative to determine the rates that would be received). I have searched this forum and found a similar post http://www.mrexcel.com/forum/showthread.php?t=60205. This may work if the data was primarily city, state and zip codes. The problem is, my data does not consist of zip codes, there are no comma deliminators (I wouldn't have this problem if there were) and in some instances can contain countries. There are even some instances where the city and state do not have a space between them. If someone can assist me with trying to create a macro to complete this, I would be greatly appreciated.
Here is an example of the column of data I wish to separate.
<table border="0" cellpadding="0" cellspacing="0" width="103"><colgroup><col style="mso-width-source:userset;mso-width-alt:3766;width:77pt" width="103"> </colgroup><tbody><tr style="height:12.75pt" height="17"> <td style="height:12.75pt;width:77pt" height="17" width="103">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Trenton NJ</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Trenton NJ</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Nwyrcyzn01NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Un Kingdom</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Nwyrcyzn01NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Nwyrcyzn01NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">CHICGOZN01IL</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Un Kingdom</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Moorestown NJ</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Lsan Da 13 CA</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Un Kingdom</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> </tbody></table>
I have to export data from a pdf invoice in order to re-rate calls that billed incorrectly; however, in order to do so, I had to essentially create a macro similar to text to columns to move the data from one cell across multiple cells. So far, I have the macro working like I want, but I am stuck when it comes to the city and state (this is imperative to determine the rates that would be received). I have searched this forum and found a similar post http://www.mrexcel.com/forum/showthread.php?t=60205. This may work if the data was primarily city, state and zip codes. The problem is, my data does not consist of zip codes, there are no comma deliminators (I wouldn't have this problem if there were) and in some instances can contain countries. There are even some instances where the city and state do not have a space between them. If someone can assist me with trying to create a macro to complete this, I would be greatly appreciated.
Here is an example of the column of data I wish to separate.
<table border="0" cellpadding="0" cellspacing="0" width="103"><colgroup><col style="mso-width-source:userset;mso-width-alt:3766;width:77pt" width="103"> </colgroup><tbody><tr style="height:12.75pt" height="17"> <td style="height:12.75pt;width:77pt" height="17" width="103">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Trenton NJ</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Trenton NJ</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Nwyrcyzn01NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Un Kingdom</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Nwyrcyzn01NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Nwyrcyzn01NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">CHICGOZN01IL</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Un Kingdom</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Moorestown NJ</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Lsan Da 13 CA</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">Un Kingdom</td> </tr> <tr style="height:12.75pt" height="17"> <td style="height:12.75pt" height="17">New York NY</td> </tr> </tbody></table>