excel vba object required error when copying from one workbook to another -
does know why:
set wb = workbooks.open(url) worksheets("mf in rates").range("c8:p8").copy destination:=workbooks("dashboard_final.xlsm").worksheets("hist cof").range(cells(current.row, 4), cells(current.row, 17))
would give me object required error? url valid , mf in rates valid sheet in opened spreadsheet. have give more specific filepath dashboard_final.xlsm though macro in work book??
for troubleshooting long references this, break them down individual lines , step through it. if write code this, able determine error is:
dim obook workbook dim osheet worksheet dim orange range dim vcell1 variant dim vcell2 variant vcell1 = cells(current.row, 4) vcell2 = cells(current.row, 17) set obook = workbooks(dashboard_final.xlsm) set osheet = obook.worksheets("hist cof") set orange = osheet.range(vcell1, vcell2)
Comments
Post a Comment