VBA Paste mutliple line text into a single cell - TechRepublic
Question
November 25, 2009 at 08:55 AM
mark.ivanowski

VBA Paste mutliple line text into a single cell

by mark.ivanowski . Updated 16 years, 7 months ago

I manually am copying multiple line text from VBE Modules (comments) and paste into a single cell in Excel. See the steps:
In VBE Modules select multiple lines.
Copy
In Excel: Select a cell, press {F2} and paste.
How can I write a code to edit Cell {F2} and paste?
I tried the follow and did not work (it pasted to multiple cell instead a single cell)

Sub EditPaste()
‘Edit Cell and Paste whatever is in the Clipboard.and UnWrap
ActiveCell.Select
Application.SendKeys “{F2}”
ActiveSheet.Paste
Application.Run “PERSONAL.XLSB!UnWrap”
End Sub

This discussion is locked

All Comments