This example may look a little be confusing to a new user but it is actually quite simple.
Here are some more examples of writing to a cell You can see the simple pattern here.
You can write to any cell in any worksheet from any workbook.
If you want to read in reverse order(last to first) you can do this So far we have dealt with workbooks that are already open.
Of course, having to manually open a workbook before running a Macro, defeats the purpose of automating tasks. The following VBA code opens the workbook If you are opening a workbook as Read-Only, it doesn’t matter if it is already open.
(The code below is taken from this Stack Over Flow entry) This code is fine is most situations.
However, if the workbook could be currently open in read-only mode or could be currently opened by another user then you may want to use a slightly different approach.Obviously, you cannot save changes to a workbook that is currently open as read-only.We have just seen that you can save a workbook when you close it.Immediate Window from the menu( Shortcut is Ctrl G) You can also use an Index number with Workbooks().The index refers to the order the Workbook was open or created.It is just a matter of changing the workbook name, worksheet name and the range to suit your needs.