VBAProIWish
Well-known Member
- Joined
- Jul 6, 2009
- Messages
- 1,027
- Office Version
- 365
- Platform
- Windows
Hello All,
I have used this formula several times and it has worked perfectly, until now.
When I tried this formula... (from within a macro)
...using this data here....
<TABLE style="WIDTH: 323pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=431 border=0><COLGROUP><COL style="WIDTH: 23pt; mso-width-source: userset; mso-width-alt: 1133" width=31><COL style="WIDTH: 74pt; mso-width-source: userset; mso-width-alt: 3620" width=99><COL style="WIDTH: 226pt; mso-width-source: userset; mso-width-alt: 11008" width=301><TBODY><TR style="HEIGHT: 36pt; mso-height-source: userset" height=48><TD class=xl70 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black 0.5pt solid; BORDER-LEFT: black 0.5pt solid; WIDTH: 23pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 36pt; BACKGROUND-COLOR: maroon" width=31 height=48>#</TD><TD class=xl67 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black 0.5pt solid; BORDER-LEFT: black; WIDTH: 74pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: maroon" width=99>Customer Number</TD><TD class=xl67 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black 0.5pt solid; BORDER-LEFT: black; WIDTH: 226pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: maroon" width=301>Customer Name</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl69 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: white" height=20>1</TD><TD class=xl66 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black; BORDER-LEFT: black; WIDTH: 74pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: white" width=99>ABC0123</TD><TD class=xl68 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black; BORDER-LEFT: #ece9d8; WIDTH: 226pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: white" width=301>John Smith</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl69 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: white" height=20>2</TD><TD class=xl66 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black; BORDER-LEFT: black; WIDTH: 74pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: white" width=99>ABC0124</TD><TD class=xl68 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black; BORDER-LEFT: #ece9d8; WIDTH: 226pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: white" width=301>Mary Jones</TD></TR></TBODY></TABLE>
I get this error here...
So, it works fine with 3 or more data rows, but it seems to bug when there are less than 3 data rows (not including the title row)
Can anyone help me with this one?
Thanks much
I have used this formula several times and it has worked perfectly, until now.
When I tried this formula... (from within a macro)
Code:
Selection.AutoFill Destination:=Range("A2:A" & Range("B" & Rows.Count).End(xlUp).Row)
...using this data here....
<TABLE style="WIDTH: 323pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=431 border=0><COLGROUP><COL style="WIDTH: 23pt; mso-width-source: userset; mso-width-alt: 1133" width=31><COL style="WIDTH: 74pt; mso-width-source: userset; mso-width-alt: 3620" width=99><COL style="WIDTH: 226pt; mso-width-source: userset; mso-width-alt: 11008" width=301><TBODY><TR style="HEIGHT: 36pt; mso-height-source: userset" height=48><TD class=xl70 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black 0.5pt solid; BORDER-LEFT: black 0.5pt solid; WIDTH: 23pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 36pt; BACKGROUND-COLOR: maroon" width=31 height=48>#</TD><TD class=xl67 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black 0.5pt solid; BORDER-LEFT: black; WIDTH: 74pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: maroon" width=99>Customer Number</TD><TD class=xl67 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black 0.5pt solid; BORDER-LEFT: black; WIDTH: 226pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: maroon" width=301>Customer Name</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl69 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: white" height=20>1</TD><TD class=xl66 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black; BORDER-LEFT: black; WIDTH: 74pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: white" width=99>ABC0123</TD><TD class=xl68 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black; BORDER-LEFT: #ece9d8; WIDTH: 226pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: white" width=301>John Smith</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl69 style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 15pt; BACKGROUND-COLOR: white" height=20>2</TD><TD class=xl66 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black; BORDER-LEFT: black; WIDTH: 74pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: white" width=99>ABC0124</TD><TD class=xl68 style="BORDER-RIGHT: black 0.5pt solid; BORDER-TOP: black; BORDER-LEFT: #ece9d8; WIDTH: 226pt; BORDER-BOTTOM: black 0.5pt solid; BACKGROUND-COLOR: white" width=301>Mary Jones</TD></TR></TBODY></TABLE>
I get this error here...
Runtime 1004 - AutoFill method of range class failed
So, it works fine with 3 or more data rows, but it seems to bug when there are less than 3 data rows (not including the title row)
Can anyone help me with this one?
Thanks much