pramod_studies
asked on
Extract data from one excel file into another excel file using VBSCRIPT..
hello
I am new to vbscript. I am trying to write a script to find few values from one excelsheet and put into another. purpose being, my first file has raw type of data so I will search data on particular criteria and put into new file well formatted.. so far I could get the value seen via msgbox,, but nothing more.. also I want scan through entire file for first file..
Set objExcel = CreateObject("Excel.Applic ation")
Set objWorkbook = objExcel.Workbooks.Open("C :\Pramod\S cripting\t est1.xls")
objExcel.Visible = True
Dim ServerNameAndOS
Dim SeverityLevel
Dim Titless
Dim PortServis
Set objWorksheet = objWorkbook.Worksheets(1)
Set objRange = objWorksheet.UsedRange
For Each objCell In objRange
objRange.find ("Vulnerabilities (").Activate
intServerOSNameROW= objExcel.ActiveCell.Row -1
ServerNameAndOS = objExcel.Cells(intServerOS NameROW,1)
msgbox ServerNameAndOS
Next
I am new to vbscript. I am trying to write a script to find few values from one excelsheet and put into another. purpose being, my first file has raw type of data so I will search data on particular criteria and put into new file well formatted.. so far I could get the value seen via msgbox,, but nothing more.. also I want scan through entire file for first file..
Set objExcel = CreateObject("Excel.Applic
Set objWorkbook = objExcel.Workbooks.Open("C
objExcel.Visible = True
Dim ServerNameAndOS
Dim SeverityLevel
Dim Titless
Dim PortServis
Set objWorksheet = objWorkbook.Worksheets(1)
Set objRange = objWorksheet.UsedRange
For Each objCell In objRange
objRange.find ("Vulnerabilities (").Activate
intServerOSNameROW= objExcel.ActiveCell.Row -1
ServerNameAndOS = objExcel.Cells(intServerOS
msgbox ServerNameAndOS
Next
ASKER
Hi
First of all thank you for your reply. I have uploaded the file
https://filedb.experts-exchange.com/incoming/ee-stuff/4978-sourcefile.zip
First of all thank you for your reply. I have uploaded the file
https://filedb.experts-exchange.com/incoming/ee-stuff/4978-sourcefile.zip
ASKER
When I find text "Vulnerability (", I know right above that line I have a OS/Server information, so I can get that information. then I need to find for QID, Severity, Tile keywords and get respective values,, then go to next line... and so on...
then I need to look for another "Vulnerability (" to see if there is any other server listed. if found then again search for QUD, severity fields on next line and so on...
then I need to look for another "Vulnerability (" to see if there is any other server listed. if found then again search for QUD, severity fields on next line and so on...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
a sample file to an accessible web site, and come back
here to post a link to the file.
If you do not have your own web space, you can use
http://www.ee-stuff.com. Please be advised that you
will have to zip your file(s) before uploading if you use that
service.