VBA code to extract specific data

andycondor

New Member
Joined
Mar 23, 2013
Messages
25
Hi All,

I'm new to coding, and looking for some help/guidance. Watched bunch of youtube how to's, and still lost.

In short, I have data source that i extract weeks (for performance monitoring), and it is in txt file, that I (as a start) will paste into the excel sheet, and run macro to extract data from it. It will have about 1500 lines of data or so, but I want to see only certain data.

Here is how it looks

TX:=> RTRV-PM-OC192:test1:OC192-3-5-1:57::SES-L,,ALL,ALL,1-DAY,ALL,,:,;
Response(Sid: test1, Command=RTRV-PM-OC192, Ctag=57, Completion=COMPLD)
13-03-22 19:56:12

TX:=> RTRV-PM-OC192:test1:OC192-3-6-1:59::CV-L,,ALL,ALL,1-DAY,ALL,,:,;
Response(Sid: test1, Command=RTRV-PM-OC192, Ctag=59, Completion=COMPLD)
13-03-22 19:56:13
OC192-3-6-1,OC192:CV-L,6418,PRTL,NEND,RCV,1-DAY,03-22,00-00,0,,,

So, if it has 3 lines, that means there was no data to be diplayed, basically it's displaying command that was run, and when,

In second batch, there is more than 3 lines, First 3 lines display command that ran and when, and 4th line displays data output (if there was any, could be that 1 extra line or more). When macro is run, I want to see only data with 4 lines or more, and it needs to run until end of sheet to display all data.

Where can I start?

Andy​
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
The easiest way is to import the data via the Text Import Wizard. In Excel 2003 this is Data - Import External Data - Import Data - browse to the .txt file (the Data Source) and continue with the Text Import Wizard. It should be similar in other versions of Excel. Record these steps with the Macro Recorder if you want to generate the code for further editing.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,196,483
Messages
6,015,460
Members
441,897
Latest member
erma

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top