Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do you Delete Vbcrlf from a string?

Posted on 1998-12-04
2
Medium Priority
?
328 Views
Last Modified: 2008-03-10

How do you Delete all VbCrLf from a string?
0
Comment
Question by:vbvpg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
traygreen earned 40 total points
ID: 1448260
You can look for it using instr and then mid it out.
vbcrlf is a two character string comprised of ASCII chars 10 & 13

   Dim iCRLFPos As Integer
   
   iCRLFPos = InStr(1, Text1.Text, vbCrLf)
   If iCRLFPos > 0 Then
      If iCRLFPos = 1 Then
         Text1.Text = Mid(Text1.Text, 2)
      Else
         Text1.Text = Mid(Text1.Text, 1, iCRLFPos - 1) & Mid(Text1.Text, iCRLFPos + 2)
      End If
   End If

0
 
LVL 1

Expert Comment

by:muffinthedog
ID: 1448261
?
While InStr(str, vbCrLf)
    str = Left(str, InStr(str, vbCrLf) - 1) & Right(str, Len(str) - InStr(str, vbCrLf) - 1)
Wend

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question