Hi all,
I have the following code:
Which is supposed to copy the row (my active cell is in) from the first table to the second, exactly as it is. The second table is the exact copy of the first under a different name and it's databodyrange deleted. I do have formulas in the last 3 columns (sum formulas to sum a range from the same row like: "=SUM([@[a column]:[another column]])") I don't know if they are the trouble makers.. I just don't know why this won't work....
Please help!
Posted on ExcelForum as well. Link: https://www.excelforum.com/excel-pr...od-of-range-class-failed-why.html#post5127244
I have the following code:
Code:
[COLOR=#333333]If Not Intersect(Selection, ActiveSheet.ListObjects(1).DataBodyRange) Is Nothing Then[/COLOR]<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">
Dim CopyRownr As Long
CopyRownr = ActiveCell.Row - ActiveSheet.ListObjects(1).HeaderRowRange.Row
Dim CopyRow As Range
Set CopyRow = ActiveSheet.ListObjects(1).ListRows(CopyRownr).Range
CopyRow.Copy Destination:=ActiveSheet.ListObjects(2).ListRows.Add 'This is the highlighted line by the debugger
</code>[COLOR=#333333]End if[/COLOR]
Which is supposed to copy the row (my active cell is in) from the first table to the second, exactly as it is. The second table is the exact copy of the first under a different name and it's databodyrange deleted. I do have formulas in the last 3 columns (sum formulas to sum a range from the same row like: "=SUM([@[a column]:[another column]])") I don't know if they are the trouble makers.. I just don't know why this won't work....
Please help!
Posted on ExcelForum as well. Link: https://www.excelforum.com/excel-pr...od-of-range-class-failed-why.html#post5127244