• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Break-Up Cell, Transpose Across With Specific Character

With the example workbook beneath, I'm trying to disect each line in range based on the character "}" end brace, and then transpose it across.


As you'll see it works fine, but the problem I'm running in to and why I need help is that it doesn't seem to work if an end brace is missing.


My aim for this is to break-up and transpose every line in range after each appearance of the end brace "}".


That's simply it.


I'm using a UDF already in place, but I'm either not using it right, or perhaps someone here on Chandoo will have an easier solution all together (I'm open to any and all fresh ideas and approaches).


Not every line will have 30 end braces, but in case I run into a line with up to 30 I wanted to make sure the code would still work.


As I stated earlier, if someone has a new approach all together I'm open to anything.


And thanks in advance for your time (extremely appreciative).


My expected end result should be what you see when you first disect the line (once you download the file and test it). It works perfect this way because no end brace is missing. My goal is to achieve this same result regardless of how many end braces "}" the line has.


Of course I will come across some lines with no end braces at all, and in that case of course I would like the code to count the entire line as one complete segment (or skip it all together).


Depending on how many segments it has is how many columns across I would like it to transpose.


If anyone needs more clarification on this please let me know.


http://www.iandmyself.me/disect.and.transpose.segments.xlsm
 
Hi Indi,


I'm afraid I can't open the file to see all the details, but can you do something that incorporates a "check" like this:


Sub CheckForExistance()

If InStr(1, Word_Being_Searched, "}") > 0 Then

'End brace found, do stuff here

End If

End Sub
 
Sounds simple enough, but the transposing the line coding would be the challenging part I guess.


Is there any way I could email this workbook perhaps?
 
Back
Top