I am trying to use the first 12 characters of a cell (before the first comma of the string) as a value in a macro. I just can't remember the formula for the macro to bascialy trim everything after the first comma, if there is a comma.
if my 5 values are (B1 - B5)
<TABLE style="WIDTH: 284pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=379 border=0><COLGROUP><COL style="WIDTH: 284pt; mso-width-source: userset; mso-width-alt: 13860" width=379><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 284pt; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" width=379 height=20>Column B
RD003431, xyw , xyw
</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20> blank cell</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20> blank cell</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>Storeroom Location, Courier</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>RD003577 A05, xyz</TD></TR></TBODY></TABLE>
so for B1, x = RD003431 and trim everything after that first comma, I then use that value for other calculations in the macro. If the value is blank or does not have the RD in the first 2 chars I want to skip the cell. I just can't figure out how to get the value to x that I want to process furher in my macro...
if my 5 values are (B1 - B5)
<TABLE style="WIDTH: 284pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=379 border=0><COLGROUP><COL style="WIDTH: 284pt; mso-width-source: userset; mso-width-alt: 13860" width=379><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 284pt; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" width=379 height=20>Column B
RD003431, xyw , xyw
</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20> blank cell</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20> blank cell</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>Storeroom Location, Courier</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl118 style="BORDER-RIGHT: #c0c0c0; BORDER-TOP: #c0c0c0; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: #c0c0c0; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>RD003577 A05, xyz</TD></TR></TBODY></TABLE>
so for B1, x = RD003431 and trim everything after that first comma, I then use that value for other calculations in the macro. If the value is blank or does not have the RD in the first 2 chars I want to skip the cell. I just can't figure out how to get the value to x that I want to process furher in my macro...