CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2005
    Posts
    23

    removing specific characters from a string using vba

    hi

    i have a string called 'name' which contains value as "Employee report report", when i am displaying name varible i need to display only "Employee report" meaning i want to remove one 'report' from the string can some1 pls help.

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: removing specific characters from a string using vba

    yourString=replace(yourString,"report report","report")
    ...check sintax for vba....
    change name to your variable: 'name' is a reserved word...
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    May 2005
    Posts
    23

    Re: removing specific characters from a string using vba

    hi thanks for ur suggestion

    i have 1 more question the name variable can contain any string i need to search for a word report in that string and replace it with a space. if report word is found more then 1 time then u need to delete only once using vba

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

Featured