I would like to compare the cells in one excel spread sheet to match the second spread sheet.
If ID in new xlsx = ID in the old xlsx
Thanks
Technology Tips and News
I would like to compare the cells in one excel spread sheet to match the second spread sheet.
If ID in new xlsx = ID in the old xlsx
Thanks
How do I copy cells that are in one xlsx file to another one that already exists. Lets say test1.xlsx has a name colunm and I want to copy that name in to another file test2.xlsx,
Thanks
Hi,
Please read the following:
Bill
Cells, Columns and rows all have a 'Copy' method. Post in the Excel VBA forum to learn how to use Excel object model. Once you learn how to do it in VBA you can convert what you have learned to PowerShell.
$sheet2.Range(<source range>).Copy(<targetrange>)
You can also look in the Repository (link above) for examples of how to use Excel with PowerShell.
The simplest single cell copy is:
$sheet2.Cells.Item(1,1)=$sheet1.Cells.Item(1,1)
This thread shows up with two titles. One is marked Copy and the other compare.
If the real question is "compare" then the example is correct but need to compare instead of assign. The cell references for copy are identical to compare.
Start by learning VBA then learn PowerShell then convert the VBA examples to PowerShell. Simple.
you can use this as example... hope this is userful...
$newxlsxfile = "test1.xlsx"