Hi all,
I have the following code, which basically adds a line-space (Alt+Enter)to all the cells found in Column D in a worksheet called "Sheet 1". The line spacing applied to each cell is included before and after the text found within each cell. Therefore, for example, each cell will look like this:
(Alt-Enter)
"Text"
(Alt-Enter)
Is it possible to revert the VBA, or make another VBA to REMOVE the line-spacing (both line-spacing before and after) and leave just the text?
Thanks a lot everyone
Kindly find the code below:
Sub AutoFit()
For i = 1 To Worksheets("Sheet1").Cells(Rows.Count, "D").End(xlUp).Row
Worksheets("Sheet1").Cells(i, "D") = Chr(10) & Worksheets("Sheet1").Cells(i, "D").Text & Chr(10)
Next i
End Sub
Bookmarks