View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mackay 1979 Mackay 1979 is offline
external usenet poster
 
Posts: 4
Default Loop through data for conditions and create a new sheet

Could anyone assist with a problem I've got trying to 'tidy' up a data source
I'm working wth. I'm currently importing a file (dat file) into Excel.

I need to be able to loop through the file and perform the following:

1) Loop through for each entry that begins +BV and contains additional data
in the cell, not = ENSTRH.
e.g. Cell A5 = "+BV Header Test"
When this appears create a new sheet and put the data from this cell into
Sheet2:A2
(If possible it would be useful to not then include the +BV)

2) Continue looping through the entrys and do the same for any entries with
+BY, but put at the side of the one above (e.g. "+BY Value x" exists, so this
would then offset from Cell A5 and get put into B5.

3) The next +BV entry (as per Step 1) will then go onto the next row and so
on...

Thanks for your help on this. Al ( )