shemayisroel
Well-known Member
- Joined
- Sep 11, 2008
- Messages
- 1,867
Hi,
I have a set of data that's fixed length - 19 characters per field with 17 Headers. Data structure is below. Each record comes over 3 rows as defined below and not all fields for every record will contain data. Looking for a VBA code that can extract the data and place each field (header) in a seperate column. This can be achieved (and have done so) via the "Text to Columns" but looking to now automate this via VBA.
<TABLE style="WIDTH: 928pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=1237><COLGROUP><COL style="WIDTH: 928pt; mso-width-source: userset; mso-width-alt: 45238" width=1237><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; WIDTH: 928pt; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl63 height=20 width=1237>Field1 Field2 Field3 Field4 Field5 Field6 Field7 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl63 height=20>Field8 Field9 Field10 Field11 Field12 Field13 Field14 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl63 height=20>Field15 Field16 Field17 </TD></TR></TBODY></TABLE>
I have a set of data that's fixed length - 19 characters per field with 17 Headers. Data structure is below. Each record comes over 3 rows as defined below and not all fields for every record will contain data. Looking for a VBA code that can extract the data and place each field (header) in a seperate column. This can be achieved (and have done so) via the "Text to Columns" but looking to now automate this via VBA.
<TABLE style="WIDTH: 928pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=1237><COLGROUP><COL style="WIDTH: 928pt; mso-width-source: userset; mso-width-alt: 45238" width=1237><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; WIDTH: 928pt; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl63 height=20 width=1237>Field1 Field2 Field3 Field4 Field5 Field6 Field7 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl63 height=20>Field8 Field9 Field10 Field11 Field12 Field13 Field14 </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl63 height=20>Field15 Field16 Field17 </TD></TR></TBODY></TABLE>