Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA problem importing and auditing Unix reports

I have been tasked to analyze data from several unix reports (downloade
to C:\). I just recently had my first exposure to VBA but am trying m
best. I wish to import these reports into Excel. I would need t
"clean up" (remove empty rows,sort the data, and remove certai
unwanted text such as mulitple headers). when all is done, i woul
need to be left with a worksheet for each report and a consolidate
master with combined information.
I already have the code for deleting emptly rows. Attached is
sample(4 pages of many) of the downloaded report. Any help would b
greatly appreciated

Attachment filename: openpo.txt
Download attachment: http://www.excelforum.com/attachment.php?postid=55993
--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA problem importing and auditing Unix reports

This gets you down to the details:

You can add back your desired heading and use Excel to build any subtotals
you need.

Sub AAOpenReport()
' Change the next to lines to refer to your report file.
ChDir "C:\Data6"
Workbooks.OpenText Filename:="C:\Data6\openpo.txt", Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), _
Array(11, 1), Array(16, 1), _
Array(33, 1), Array(44, 1), _
Array(65, 1), Array(70, 1), _
Array(81, 1), Array(91, 1), _
Array(100, 1), Array(110, 1), _
Array(122, 1))
Set rng = Columns(1).SpecialCells(xlBlanks)
rng.EntireRow.Delete
With Columns(1)
.Replace What:="RTROPNPO", Replacement:="=Na()", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
.Replace What:="R*", Replacement:="=Na()", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

.Replace What:="DIST*", Replacement:="=Na()", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
.Replace What:="---*", Replacement:="=Na()", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
.Replace What:="PO", Replacement:="=Na()", _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False

End With
Columns(2).Replace What:="At", _
Replacement:="=Na()", LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=True
Columns("A:B").SpecialCells(xlFormulas, _
xlErrors).EntireRow.Delete
End Sub

--
Regards,
Tom Ogilvy

"acarril " wrote in message
...
I have been tasked to analyze data from several unix reports (downloaded
to C:\). I just recently had my first exposure to VBA but am trying my
best. I wish to import these reports into Excel. I would need to
"clean up" (remove empty rows,sort the data, and remove certain
unwanted text such as mulitple headers). when all is done, i would
need to be left with a worksheet for each report and a consolidated
master with combined information.
I already have the code for deleting emptly rows. Attached is a
sample(4 pages of many) of the downloaded report. Any help would be
greatly appreciated.

Attachment filename: openpo.txt
Download attachment:

http://www.excelforum.com/attachment.php?postid=559933
---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA problem importing and auditing Unix reports

THANKS!!! I tried it and it worked

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula auditing problem marnie Excel Discussion (Misc queries) 0 March 25th 09 01:22 PM
Importing Crystal Reports into Excel 2007 possible? Axe2Grind Excel Worksheet Functions 0 November 14th 08 06:58 PM
Importing Data problem Testing Excel Discussion (Misc queries) 4 March 12th 07 12:56 PM
Importing Problem workerboy Excel Worksheet Functions 0 May 15th 06 01:45 PM
Problem with Pivot table reports Shanmugavel Excel Programming 2 December 13th 03 04:27 PM


All times are GMT +1. The time now is 04:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"