-1

I used the VBA code in "How do you write an Excel formula that will paste a specific value in a different cell?" posted here in May 2013 and it works well to populate/fill another cell in the same spreadsheet. I would like to do the same but fill a cell in a different spreadsheet. I basically have a Form that has fields that auto-populate from a Master spreadsheet and in certain scenarios I want to be able to update the Master from the form... hence populate a cell in the Master. I am a newbie to VBA, in fact I was happy to be able to just cut and paste the code and it worked as I do not understand the code and it was my first time doing anything with VBA Thanks

1 Answers1

0

If you have both sheets open, you can simply use

Workbooks("Book2.xls").Sheets("Sheet1").Cells(1,1).Value = updatedValue

where "Book2.xls" is the workbook you are updating, "Sheet1" is the sheet within Book2 you are updating, and cell A1 is the cell to update. updatedValue is a variable containing whatever you want to update the value to.

This is Microsoft's Getting Started with VBA guide. I would highly recommend taking a look through it and understanding the code you have. This will help you solve your own problems in the future instead of needing to ask for code to copy and paste.