Please help me with this error of #ref

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).

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
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Since the values are calculated from cells in another workbook, you can't really use the .Paste method. Try using .PasteSpecial instead:

Code:
Activesheet.PasteSpecial xlPasteValues

WBD
 
Upvote 0
Hi,
I tried the pastespecial xlpastevalues but it state pastespecial method of worksheet class failed. How can I resolved this problem?
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,823
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top