ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Text subsequences (https://www.excelbanter.com/excel-worksheet-functions/62066-text-subsequences.html)

paulinoluciano

Text subsequences
 
"Is there some VBA code with which could I obtain all internal
subsequences from a text after or using some
specific rules? The resulting subsequences should be expressed on
consecutive cell bellow the precursor text. For example I have the
text:

AASSASDKASASDASFAFSASASADKASASAFPKQREWEAQEOKSPADAO EKOQPPDAOPSKAEPQ

Example 1:
Rules:
a) Cut sequence before K but not always (you could have lost cut)
b) Sequence is not cut if K is found before FP

Results:

AASSASDKASASDASFAFSASASADKASASAFPKQREWEAQEOKSPADAO EKOQPPDAOPSKAEPQ

0 lost cut:
AASSASDK
ASASDASFAFSASASADK
ASASAFPKQREWEAQEOK
SPADAOEK
OQPPDAOPSK
AEPQ

1 lost cut:
AASSASDKASASDASFAFSASASADK
ASASAFPKQREWEAQEOKSPADAOEK
OQPPDAOPSKAEPQ
AASSASDKASASDASFAFSASASADKASASAFPKQREWEAQEOK
SPADAOEKOQPPDAOPSKAEPQ

2 lost cut:
AASSASDKASASDASFAFSASASADKASASAFPKQREWEAQEOK
SPADAOEKOQPPDAOPSKAEPQ

Repair that in some cases I need lost cuts in which you cut after 1, 2,
3, 4,... specific characters.
I have to specify such rules in some place of the sheet containing the
precursor text.
The rules a

Cut after "XXX"
Cut before "XXX"

Never before "XXX"
Never after "XXX"

Number of times that the character could be missed prior cut "XXX"



All times are GMT +1. The time now is 02:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com