filter or remove pieces of sequences

laszlos

New Member
Joined
Nov 29, 2009
Messages
2
I have a column with thousands of rows like this:

actgctgattgATGGCTGRSTYGG etc., i.e. about 1000 lowercase letters followed by hundreds of capitals always starting with ATG.

I need to remove anything from the ATG on (i.e. all capitals) so that only lowercase letters remain in the column. Alternatively, only the lowercase bunches of letters could be copied to a new column.

I would highly appreciate help on this!

Thanks and greetings,

laszlos
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,751
HI laszlos
Welcome to the board

You can use TextToColumns with delimiter "A"
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,247
Office Version
365
Platform
Windows
I have a column with thousands of rows like this:

actgctgattgATGGCTGRSTYGG etc., i.e. about 1000 lowercase letters followed by hundreds of capitals always starting with ATG.

I need to remove anything from the ATG on (i.e. all capitals) so that only lowercase letters remain in the column. Alternatively, only the lowercase bunches of letters could be copied to a new column.

I would highly appreciate help on this!

Thanks and greetings,

laszlos
Welcome to the MrExcel board!

Try this:

1. Select the column by clicking its heading label.

2. Edit|Replace...|Find what: ATG*|Replace with: leave blank|Options>>|tick 'Match case'|Replace All|Ok|Close
 

laszlos

New Member
Joined
Nov 29, 2009
Messages
2
Hi PGC and Peter,

Thanks a lot, you both made my life easier :).
I notice that TextToColumns not simply splits the text into two columns but also removes the delimiter (in this case A). It is no problem right now but later I might need to save both parts intact. Is there a way to do it?

Thanks,

Laszlo
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,751
I notice that TextToColumns not simply splits the text into two columns but also removes the delimiter (in this case A). It is no problem right now but later I might need to save both parts intact. Is there a way to do it?
Laszlo

TextToColumns eats the delimiters. If you need both parts of the strings, better copy the column and use Peter's solution, to get what's before ATG. You can then get what's after ATG for ex. with a string function. If the ATG string only occurs once in the text, you can also use Peter's solution to get the second part, replacing *ATG with ATG.
 
Last edited:

Forum statistics

Threads
1,082,172
Messages
5,363,546
Members
400,749
Latest member
mgc8cc

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top