Deleting a row in a message (opposite to VbCrLf)

  • Thread starter Thread starter Wesslan
  • Start date Start date
W

Wesslan

Hi,

I am interested in deleting a blank row in a message. I know that if I
want to add a row I use the command VbCrLf, but is there one to delete
a row?

Any help/suggestions greatly appreciated.

Regards

Peder
 
Maybe you need to show your code, but perhaps something like this:

Dim strMsg as string

strMsg = "message" & vbcrlf & "with linebreak"

strMsg = Replace(strMsg, vbcrlf, vbnullstring)

Msgbox strMsg


RBS
 
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
 
Simpy replace this:

ttext = ttext & vbCrLf

with this:

If i < 3 then
ttext = ttext & vbCrLf
end if


RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top