Results 1 to 2 of 2

Thread: stripping inverted commons out of a word

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2011
    Posts
    255

    stripping inverted commons out of a word

    hi
    i read text in an excel file as follows
    Code:
     oRng = oWSSheet.Cells.Find("UNREALIZED LOSS - FVTPL_HFT_SEC (LONG) (59612102)", , _
                 Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlPart, _
                 Excel.XlSearchOrder.xlByRows, Excel.XlSearchDirection.xlNext, False)
            ' MsgBox("Value '" & oRng.Value & "' found at '" & oRng.Address)
            Me.unrealse = oRng.Offset(0, 5).Valu
    so in the above example it looks for the words UNREALIZED LOSS - FVTPL_HFT_SEC (LONG) (59612102)

    but in one of the excel files the words are like this "UNREALIZED LOSS - FVTPL_HFT_SEC (LONG) (59612102)"
    when i try to do the code as usual like the above code i get an error is there something i can put in my code to strip out the "" around the words

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: stripping inverted commons out of a word

    That would be "inverted commas", and you can do it like so:
    Code:
    myString = myString.Replace(ControlChars.Quote, String.Empty)
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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