Excel: Writing Multiple Lines In The Same Cell

How to write multiple lines (to simulate Alt+ enter that adds a new line) inside a single cell in Excel?

There are two approaches by which a new line can be added while passing content into a single cell. These approaches are explained below:


Approach #1: Use of the hotkey activity - this approach is more efficient only if this needs to be done on less number of cells. Otherwise, clicking on multiple cells and sending hotkey might not be an optimal solution.

Solution:

  1. Select the cell into which data needs to be entered
  2. Send Hot key F2 (to go to formula bar for the selected cell)
  3. Type into the first line (Selector of the formula bar)
  4. Send hotkey Alt+Enter (Selector of the formula bar)
  5. Type into the Send line (Selector of the formula bar)
  6. Send hot key (Enter Selector of the formula bar)


Approach #2: Use the new line character - This approach is explained as follows.
Solution:

  1. Have a workflow with Read Cell and write cell with arguments for the cells and the text
  2. The write cell activity should incorporate the "Environment.NewLine" attribute that helps in creating the new line inside the cell, as shown in the screenshot below
  3. Call this workflow in the iteration building a logic around to find the right cell


Alternative Approach:

  • If there are several iterations, keep appending the new line character to a variable (say Column1). At the end of the loop write into the respective cells.