I need to format this number
<TABLE style="WIDTH: 77pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=103 border=0><COLGROUP><COL style="WIDTH: 77pt; mso-width-source: userset; mso-width-alt: 3766" width=103><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl72 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 77pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=103 height=17>030411</TD></TR></TBODY></TABLE>
to this one
<TABLE style="WIDTH: 74pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=98 border=0><COLGROUP><COL style="WIDTH: 74pt; mso-width-source: userset; mso-width-alt: 3584" width=98><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl72 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 74pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=98 height=17>110304</TD></TR></TBODY></TABLE>
and assign it to the variable Reval
I am using the following code:
Dim Reval As String
Reval = ActiveCell.FormulaR1C1 = "=Right(RC[-9], 2)&Left(RC[-9], 4)"
Reval is returning FALSE with this code.
This formula outside of vba returns correctly =RIGHT(F2176,2)&LEFT(F2176,4)
Any help is appreciated.
<TABLE style="WIDTH: 77pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=103 border=0><COLGROUP><COL style="WIDTH: 77pt; mso-width-source: userset; mso-width-alt: 3766" width=103><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl72 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 77pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=103 height=17>030411</TD></TR></TBODY></TABLE>
to this one
<TABLE style="WIDTH: 74pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=98 border=0><COLGROUP><COL style="WIDTH: 74pt; mso-width-source: userset; mso-width-alt: 3584" width=98><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl72 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 74pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=98 height=17>110304</TD></TR></TBODY></TABLE>
and assign it to the variable Reval
I am using the following code:
Dim Reval As String
Reval = ActiveCell.FormulaR1C1 = "=Right(RC[-9], 2)&Left(RC[-9], 4)"
Reval is returning FALSE with this code.
This formula outside of vba returns correctly =RIGHT(F2176,2)&LEFT(F2176,4)
Any help is appreciated.
Last edited: