Results 1 to 2 of 2

Thread: [RESOLVED] Deleting all spaces from text

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    2

    Resolved [RESOLVED] Deleting all spaces from text

    I'm v. new to VB and am trying to upload text into a data base but without the spaces.

    I could only come up with a very long winded way using Trim and some other functions. Is there a way to do this more simply?

    The text is alpha numeric with % symbols etc. and is sent to me in a single cell in Excel.

    Any help much appreciated

    Davellll

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Deleting all spaces from text

    Hi davellll, welcome to VBForums!

    Which version of VB are you using, and what sort of code have you got?

    If you are using VB 6 (or VBA in Office), you can use Replace to remove characters, by replacing them with 'no text', eg:
    VB Code:
    1. yourstring = Replace(yourstring, " ", "")

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