siva_sivam
New Member
Am new to excel Macro and trying to copy a value of a Cell E15 from a workbook name
september to D15 of another workbook name format and am unable to do that with the below coding.
Please help me
I used the below coding to do so.
Sub COPYCELL()
Dim wbk As Workbook
strFirstFile = "c:documents and SettingsmsivasDesktopJamesSeptember.xls"
strSecondFile = "c:documents and SettingsmsivasDesktopJamesFormat.xls"
Set wbk = Workbooks.Open(strFirstFile)
With wbk.Sheets("Summary")
Range("E15").Copy
End With
Set wbk = Workbooks.Open(strSecondFile)
With wbk.Sheets("sheet1")
Range("D12").PasteSpecial Paste:=xlPasteAll
End With
End Sub
Am receiving an error and unable to know.
september to D15 of another workbook name format and am unable to do that with the below coding.
Please help me
I used the below coding to do so.
Sub COPYCELL()
Dim wbk As Workbook
strFirstFile = "c:documents and SettingsmsivasDesktopJamesSeptember.xls"
strSecondFile = "c:documents and SettingsmsivasDesktopJamesFormat.xls"
Set wbk = Workbooks.Open(strFirstFile)
With wbk.Sheets("Summary")
Range("E15").Copy
End With
Set wbk = Workbooks.Open(strSecondFile)
With wbk.Sheets("sheet1")
Range("D12").PasteSpecial Paste:=xlPasteAll
End With
End Sub
Am receiving an error and unable to know.