Hello,
I am creating a Microsoft PAD flow using VBScript to filter and move data from one document to another. Am I able to open multiple files within the VBScript and have it paste into that document?
For instance, with the script below, I need the filtered data from the %FilePathBrandAging% variable to paste into another document. I have the below VBScript written so far. How would I add additional documents to the script, manipulate data on those documents, and copy into a final template?
Set xlApp=Createobject("Excel.Application")
Set xlWbk=xlApp.Workbooks.Open("%FilePathBrandAging%")
xlApp.Visible=true
Set xlWksht = xlWbk.ActiveSheet
Set xlWksht = xlWbk.Worksheets(1)
xlWksht.Range("D:D").AutoFilter %FilterColumn%, Array("%FilterCR%","%FilterDR%"), 7
xlWksht.Range("A:U").Copy
Set xlWksht = xlWbk.Worksheets(2)
xlWksht.Range("A1").PasteSpecial
Set xlWksht = xlWbk.Worksheets(1)
xlWksht.Range("D:D").AutoFilter %FilterColumn%, "%FilterPMT%"
xlWksht.Range("A:U").Copy
Set xlWksht = xlWbk.Worksheets(3)
xlWksht.Range("A1").PasteSpecial
Set xlWksht = xlWbk.Worksheets(1)
xlWksht.Range("D:D").AutoFilter %FilterColumn%, "%FilterSLS%"
xlWksht.Range("A:S").Copy
Set xlWksht = xlWbk.Worksheets(4)
xlWksht.Range("A1").PasteSpecial
Set xlWksht = xlWbk.ActiveSheet
Set xlWksht = xlWbk.Worksheets(1)
xlWksht.Range("D:D").AutoFilter %FilterColumn%, Array("%FilterCR%","%FilterDR%", "%FilterPMT%", "%FilterSLS%"), 7
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2