How to edit text in columns?

99 views Asked by At

The data in my column is listed as i have stated below.

A  B
1  N  
2  N  
3  N        
4  Y   
5  Y   
6  N   
7  N   
8  Y    
9  Y   
10 Y    
11 Y   
12 Y   
13 N   
14 N   

I want to automate and list the first n and no other n till y appears and list the first y till the next n appears. Like this :

A  B
1  N  
2   
3          
4  Y   
5     
6  N   
7     
8  Y    
9     
10     
11    
12    
13 N   
14  

Any help is apreciated.

1

There are 1 answers

0
Gary_W On

Unless there's a tricky way I am not aware of, you'll need to write a macro that loops through the rows in the column, checking for the value to change. Pseudocode:

set a compare variable to null
loop through cells in the column
  read cell
  if cell value != compare variable
    compare = new value
    - leave cell value there
  else if cell = compare
    cell value = NULL
end loop

Let us know what you come up with.