Share via

Create new Excel entry and edit current cell value if a statement is true

Lodewyk Aucamp 1 Reputation point
2022-08-23T11:27:27.427+00:00

Hi, I have data where one cell contains multiple values split by a delimiter and needs to be separated and split into different entries for example:

Name Date Value
John 11-02-2022 x | y | z
Adam 10-02-2022 s

The above values should be transformed to look like the following:

Name Date Value
John 11-02-2022 x
John 11-02-2022 y
John 11-02-2022 z
Adam 10-02-2022 s

As you will see the Value column, if it contained a value with the delimiter [|] it should insert a new line with all the other column information copied over so that it is a single line entry.

Is there a simple VBA code or excel function that will do this?

Microsoft 365 and Office | Development | Other
Developer technologies | Visual Basic for Applications
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.