Can a excel macro be run from a .vbs file
Hi Guys
Can an excel macro be copied in to a .vbs script and run to (for example) format a .csv file?
EG, this script (to open book1.cvs and run this script??
Sub TrimTextRange()
Application.ScreenUpdating = False
Dim cell As Range, areaToTrim As Range
Set areaToTrim = Sheet1.Range("A1:H1000")
For Each cell In areaToTrim
cell.Value = Trim(cell.Value)
Next cell
End Sub
|