Hi.
What I am currently trying to achieve is to copy specific cell values between dynamically named workbooks. I have found the following code which works to some extent, but I get formulas transferred in to the receiving workbook in stead of values.
I have tried using
without luck. I have tried using
as well without luck. If anyone could help, I would be very happy.
BR
What I am currently trying to achieve is to copy specific cell values between dynamically named workbooks. I have found the following code which works to some extent, but I get formulas transferred in to the receiving workbook in stead of values.
VBA Code:
Sub import1()
Dim sFilename As Variant
Dim wsDest As Worksheet
sFilename = Application.GetOpenFilename("Excel Files, *.xls*")
If sFilename = False Then
MsgBox "Nothing Imported"
Exit Sub
End If
Set wsDest = ActiveWorkbook.Worksheets("Price sheet")
Application.ScreenUpdating = False
On Error Resume Next
With Workbooks.Open(sFilename)
.Sheets("Calculation").Range("R36").Copy wsDest.Range("Y16")
.Sheets("Calculation").Range("R33").Copy wsDest.Range("Z16")
.Sheets("Calculation").Range("R32").Copy wsDest.Range("AA16")
.Sheets("Calculation").Range("L203").Copy wsDest.Range("AB16")
.Sheets("Calculation").Range("L157").Copy wsDest.Range("AO16")
.Sheets("Calculation").Range("L158").Copy wsDest.Range("AP16")
.Close False
End With
wsDest.Range("B16").Value = DateTime.Now
On Error GoTo 0
Application.ScreenUpdating = True
Set wsDest = Nothing
End Sub
I have tried using
VBA Code:
xlpastevalues
VBA Code:
.value
BR