Hi All - I am not able to write my own VBA code without support and I have found some code on another site which works almost perfectly, but I need some advice on a tweak, but I don't know the syntax. Am I allowed to post the code here and credit the person who wrote it, but just ask for some support on changing it slightly?
It is code which allows a data validation drop-down box to accept multiple entries and puts each entry on a new line within the cell (example below without code). My issue is that the last entry in each cell automatically has a new line (vbNewLine) appended to it, making it "different" from an entry which appears at the top of the list, or mid-list when I produce a power query based on the data. I've included an example below (without the code) to illustrate my point. For example "Strawberries" in cells A2 and A5 are the "same", but in cell A4 it is "Strawberries" with a line break after, so therefore is "viewed" differently in my PowerQuery. Am I allowed to post the code in here to ask for help with changing it so the last entry in each cell doesn't have a line-break (vbNewLine) associated with it?
It is code which allows a data validation drop-down box to accept multiple entries and puts each entry on a new line within the cell (example below without code). My issue is that the last entry in each cell automatically has a new line (vbNewLine) appended to it, making it "different" from an entry which appears at the top of the list, or mid-list when I produce a power query based on the data. I've included an example below (without the code) to illustrate my point. For example "Strawberries" in cells A2 and A5 are the "same", but in cell A4 it is "Strawberries" with a line break after, so therefore is "viewed" differently in my PowerQuery. Am I allowed to post the code in here to ask for help with changing it so the last entry in each cell doesn't have a line-break (vbNewLine) associated with it?
Book1 | ||||
---|---|---|---|---|
A | B | |||
1 | List | Shop | ||
2 | Strawberries Apples Oranges | Sainsburys | ||
3 | Apples Pears | Morrisons | ||
4 | Blueberries Oranges Strawberries | Tesco | ||
5 | Oranges Apples Strawberries Blueberries | Asda | ||
Sheet1 |