I have some code that looks like:
It switches to workbook1 and selects the range. The range looks like :
b c d
<TABLE style="WIDTH: 163pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=217 border=0 x:str><COLGROUP><COL style="WIDTH: 44pt; mso-width-source: userset; mso-width-alt: 2157" width=59><COL style="WIDTH: 58pt; mso-width-source: userset; mso-width-alt: 2816" width=77><COL style="WIDTH: 61pt; mso-width-source: userset; mso-width-alt: 2962" width=81><TBODY><TR style="HEIGHT: 25.5pt" height=34><TD class=xl25 style="BORDER-RIGHT: #ebe9ed; BORDER-TOP: #ebe9ed; BORDER-LEFT: windowtext 1pt solid; WIDTH: 163pt; BORDER-BOTTOM: #ebe9ed; HEIGHT: 25.5pt; BACKGROUND-COLOR: transparent" width=217 colSpan=3 height=34 x:num="-0.27800000000000002">-0.3</TD></TR><TR style="HEIGHT: 25.5pt" height=34><TD class=xl24 style="BORDER-RIGHT: #ebe9ed; BORDER-TOP: #ebe9ed; BORDER-LEFT: windowtext 1pt solid; BORDER-BOTTOM: #ebe9ed; HEIGHT: 25.5pt; BACKGROUND-COLOR: transparent" colSpan=3 height=34> 1</TD></TR></TBODY></TABLE>
So its b c and d 3 columns merged into 1 cell.
Then it switches to workbook2 and attempts to paste them into 2 rows that are also 3 columns merged into 1 cell.
When I execute the code above I get an error that the operation requires the merged cells to be identical size. But they are. If I comment out the last line and manually press control V, it works fine.
Is this an excel vba problem or mine?
Code:
Workbooks(wb1).Activate
Range("b35:d36").Copy
Workbooks(wb2).Activate
ActiveCell.Resize(2, 1).Select
'ActiveCell.PasteSpecial (xlPasteValues)
It switches to workbook1 and selects the range. The range looks like :
b c d
<TABLE style="WIDTH: 163pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=217 border=0 x:str><COLGROUP><COL style="WIDTH: 44pt; mso-width-source: userset; mso-width-alt: 2157" width=59><COL style="WIDTH: 58pt; mso-width-source: userset; mso-width-alt: 2816" width=77><COL style="WIDTH: 61pt; mso-width-source: userset; mso-width-alt: 2962" width=81><TBODY><TR style="HEIGHT: 25.5pt" height=34><TD class=xl25 style="BORDER-RIGHT: #ebe9ed; BORDER-TOP: #ebe9ed; BORDER-LEFT: windowtext 1pt solid; WIDTH: 163pt; BORDER-BOTTOM: #ebe9ed; HEIGHT: 25.5pt; BACKGROUND-COLOR: transparent" width=217 colSpan=3 height=34 x:num="-0.27800000000000002">-0.3</TD></TR><TR style="HEIGHT: 25.5pt" height=34><TD class=xl24 style="BORDER-RIGHT: #ebe9ed; BORDER-TOP: #ebe9ed; BORDER-LEFT: windowtext 1pt solid; BORDER-BOTTOM: #ebe9ed; HEIGHT: 25.5pt; BACKGROUND-COLOR: transparent" colSpan=3 height=34> 1</TD></TR></TBODY></TABLE>
So its b c and d 3 columns merged into 1 cell.
Then it switches to workbook2 and attempts to paste them into 2 rows that are also 3 columns merged into 1 cell.
When I execute the code above I get an error that the operation requires the merged cells to be identical size. But they are. If I comment out the last line and manually press control V, it works fine.
Is this an excel vba problem or mine?