Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Wesslan" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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(R ectangle).Select oPPTApp.ActiveWindow.Selection.ShapeRange.GroupIte ms(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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Simpy replace this:
ttext = ttext & vbCrLf with this: If i < 3 then ttext = ttext & vbCrLf end if RBS "Wesslan" wrote in message ... 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(R ectangle).Select oPPTApp.ActiveWindow.Selection.ShapeRange.GroupIte ms(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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting Sheet Message | Excel Programming | |||
VBCRLF not doing anything | Excel Programming | |||
Deleting Sheet without message box | Excel Programming | |||
square boxes when using vbcrlf | Excel Programming | |||
Deleting a Prompt Message | Excel Programming |