What I want to do is for every line break in a cell, add "&0A" to the end of the line. I came up with a for Each but I don't know how to recognize line breaks.
What I want to do is for every line break in a cell, add "&0A" to the end of the line. I came up with a for Each but I don't know how to recognize line breaks.
You can use the split function to generate an array with each of the text lines, for this it is necessary to use the chr(10) or vbLf constant as a delimiter in the split function.
Once you have the array, you can use a for loop to go through each line and add what you need to the end.
it would be something like this.
The code above takes the text that is in cell A1 on Sheet1 and prints to the window immediately each line with "&0A" appended to the end of each line.
Instead of printing with Debug.Print, you can pass the data to rows of some sheet or add it to another array, this already depends on what you will finally do with this data.