Subvongola
New Member
- Joined
- Apr 26, 2017
- Messages
- 5
Hi guys
Please can you help me with this code. I have 2 workbook namely sub.xlsx and overall.xlsx. after I click on the button named update, col e72 to e110 should be copied to overall.xlsx but i do not know why the data pasted in overall.xlxs are all #ref. Why?
Cell e72 to e110 are in a workbook named sub.xlsx. e72 to e110 obtained the data from a1 to a38 (after some function).
Please can you help me with this code. I have 2 workbook namely sub.xlsx and overall.xlsx. after I click on the button named update, col e72 to e110 should be copied to overall.xlsx but i do not know why the data pasted in overall.xlxs are all #ref. Why?
Cell e72 to e110 are in a workbook named sub.xlsx. e72 to e110 obtained the data from a1 to a38 (after some function).
Code:
Sub update()
Activesheet.range ("e72:e110").copy
Workbooks.open filename:="c:\xxx\overall.xlsx"
eCol = Activesheet.range. cells (1,columns.count).end (xltoleft).column
If eCol >= 1 then eCol = eCol + 1
Activesheet.range.cells (1,eCol).select
Activesheet.paste
Activesheet.range. save
Activesheet.range. close
End Sub