RB Smissaert,
Sorry I should have showed the code right away. You suggestion is a
good one, however in my case it will lead to that all my VbCrLf are
replaced with nothing. Hence I loose all my row breaks
The code is:
Sub Top3Peers()
ttext = ""
SelectRow = 10
For i = 1 To 3
SPI = wbook1.Worksheets("Global - " & strSize & "
Cap").Range("N" & SelectRow).Value
SPI = Round(SPI)
' The company analysed is not to be part of peers
If Application.Proper$(wbook1.Worksheets(Sht).Range("C" &
SelectRow).Value) = Company Then SelectRow = SelectRow + 1
ttext = ttext & Application.Proper$
(wbook1.Worksheets(Sht).Range("C" & SelectRow).Value) & " (SPI " & SPI
& ")"
ttext = ttext & vbCrLf
SelectRow = SelectRow + 1
Next i
oPPTApp.ActiveWindow.Selection.SlideRange.Shapes(Rectangle).Select
oPPTApp.ActiveWindow.Selection.ShapeRange.GroupItems(Index:=strIndex).TextFrame.TextRange.Characters(Start:=1,
Length:=250).Select
oPPTApp.ActiveWindow.Selection.TextRange.Text = ttext
End Sub
I am looping and for earch firm and result that is taken in, a new
line is created. However, when the loop finishes there will naturally
be one too many. Any suggestions?
Regards,
Peder