-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

user292963
  • 1
  • 1
  • 2
  • 2
    Linking to the other question, posting the code you have tried and explaining what's gone wrong would all be helpful in helping us help you. – Raystafarian Jan 24 '14 at 14:45
  • this Q appears to have been bumped by a routine that bumps abandoned questions for some dumb reason. I'm shooting it a downvote as it displays an almost shocking lack of research effort. I've been advised that that will either stop the bump routine or perhaps result in the recycling of the question itself. – Alex M May 08 '20 at 23:15

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.