• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copying a particular cell from one workbook to another workbook

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.
 
Hi, siva_sivam!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the three first green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about your question...


Try adding a dot ("." unquoted) just before each "Range" statement. BTW, 2nd. range points to cell D12 and you stated D15 in the introduction.


Regards!
 
Back
Top