Link to home
Start Free TrialLog in
Avatar of pramod_studies
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.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Pramod\Scripting\test1.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(intServerOSNameROW,1)
msgbox ServerNameAndOS  
Next


Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

It would be useful to see some sample data.  Please upload
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.
Avatar of pramod_studies
pramod_studies

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

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...
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial