search for a value within a string

Will someone have the programming of how to have a variable in a list of values and when it looks for a value and finds it, it returns the following 5 letters? for example I have AABBCCCCCDDDEEEEEFF and if I search for BB, it returns CCCCC and if I search for DDD, it returns EEEEE and so on as a search function in Excel
 

Dm114

Well-known member
Will someone have the programming of how to have a variable in a list of values and when it looks for a value and finds it, it returns the following 5 letters? for example I have AABBCCCCCDDDEEEEEFF and if I search for BB, it returns CCCCC and if I search for DDD, it returns EEEEE and so on as a search function in Excel
Try this
(?<=[lv=search_key])(\w{5})
 
Top