I am making a vbscript that is outputting to an excel spreadsheet.
This will be run on multiple systems on different days, so I want to make the name of the spreadsheet
hostname&date.xls
How can I do a save as on it, I’ve been googling but can’t find it.
Also, I only have two columns but some text in the second column will be either “Test PASSED” or “Test FAILED”. There are about 25 rows. I want to make it so the rows that have “TEST PASSED” in the second column are green and then red vice versa.
How should I go about this?
I would prefer conditional formatting:
Feel free to replace Table1 with any other table object.
This will ADD new Format conditions every time one is executing this code.
To create your filename you can use
Format(Now,"dd/mm/yyyy")and the code of Omnikrys – or a FileDialog-Object.Here a full example:
ActiveWorkbook.SaveAs Environ$("computername") & "_" & Format(Now, "dd-mm-yyyy") & ".xlsx"