I am beginner in VBA and am finding it hard to understand what is wrong with my below statement. To give a context of what I am trying to do, I have a source sheet (oldViewsWbk) whose cells I want to copy into my final workbook (finalViewsWbk) and then do some logic over these copied cells.
ActiveSheet.Range(Cells(2, 2), Cells(246, 2)).Value = oldViewsWbk.Sheets(1).Range(Cells(2, 2), Cells(246, 2)).Value
My ActiveSheet is my final workbook. For now I have hard-coded the row and column numbers, but they will be replaced by variables once I can get this working.
I know I can use Copy and PasteSpecial to get this done, but I am wondering why this particular statement keeps throwing the error '1004': Object defined or Application defined error
. Maybe I cant do this way at all, but I would like to know whats the reason behind it.
Many Thanks!