View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Printing truncates cell contents

I think it's either going to be a manual effort (row by row) if you hate the
extra line within the cell for the rows that currently print ok.

One of the things that would concern me is that the paper copy may look fine on
my printer, but if I share it with others, it may not look fine for them.

If you decide to add that extra alt-enter to just the cells you want, you could
select the range first and use a macro to do the work.

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range

Set myRng = Nothing
On Error Resume Next
Set myRng = Intersect(Selection, _
Selection.SpecialCells(xlCellTypeConstants, xlTextValues), _
ActiveSheet.UsedRange)
On Error GoTo 0

If myRng Is Nothing Then
MsgBox "Try another selection!"
Exit Sub
End If

For Each myCell In myRng.Cells
If Right(myCell.Value, 1) = vbLf Then
'already there, so skip this cell
Else
myCell.Value = myCell.Value & vbLf
End If
Next myCell

End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)



BDT wrote:

Hi Dave,

Your idea works - sort of. If I only had a couple of easy to identiry
problem cells, your idea would be OK.

If I do that for one of the problem cells, it prints out OK, but it adds a
blank line at the end of the text on the screen so it doesn't display
onscreen correctly. Since there are many hundred rows I would need to find a
way to apply this to all cells, but then the rows that print out fine now,
print with an extra blank line at the bottom of the cell.

So I'm still stumped.

thanks, BDT

"Dave Peterson" wrote:

Maybe you can include an extra alt-enter as the final character in the cell?


--

Dave Peterson