Results 1 to 3 of 3

Thread: Newbie --- Need help with this ....

  1. #1

    Thread Starter
    Lively Member fundean's Avatar
    Join Date
    Apr 2001
    Posts
    98

    Newbie --- Need help with this ....

    How can I change the following code so that it eliminates the quotes ("...") from a text string stored in a column in Excel? Apparently, tthe code on the bottom will only remove empty spaces:

    Public Function RemoveSpaces(strInput As String)
    ' Removes all spaces from a string of text
    Test:
    If InStr(strInput, " ") = 0 Then
    RemoveSpaces = strInput
    Else
    strInput = Left(strInput, InStr(strInput, " ") - 1) _
    & Right(strInput, Len(strInput) - InStr(strInput, " "))
    GoTo Test
    End If
    End Function

    Thank You !

  2. #2
    Lively Member
    Join Date
    Aug 2005
    Posts
    77

    Re: Newbie --- Need help with this ....

    You can try this
    Code:
    Function ReplaceDot(strIn as String) as String
       ReplaceDot = Replace(strIn, ".", "")
    End Function

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Newbie --- Need help with this ....

    If you want to remove QUOTES (") then use this:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.   Dim str$
    5.   str = """test"""
    6.   str = Replace$(str, Chr(34), "") ' <-------  Replace ALL occurrences
    7.   MsgBox str
    8. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width