Question:
I need to run PS script on multiple xlsx files where I need to search and replace certain values. Script has to check entire sheet, but needs to ignore first 4 columns, aka, it has to “start” from column number 5. Is there a way how to do that with the script below please? Those first 4 columns need to be present when exporting/saving a final xlsx file. Thank you.Answer:
You could replace your second foreach loop with a for loop instead, as you’ll then be able to skip the first x records as desired.It would look like this to skip the first 4 columns:
$i = 4
with another number if you want to start on a different column number instead.If you have better answer, please add a comment about this, thank you!