+ Reply to Thread
Results 1 to 5 of 5

parsing text return space to space

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    nj
    MS-Off Ver
    Excel 2013
    Posts
    17

    parsing text return space to space

    Hi,

    I'm a noob trying to get up to speed on some fairly complicated xlsx files and VBA.

    But one thing the expert in the office can't remember is when he has VBA code to look through a .txt file,
    return all the text between the white spaces.

    currently he has code that will pull a specific number of digits (kinda like mid(4,6) )

    this works ok usually but sometimes the number of digits in the txt report we are pulling from changes. and time looking through the code or the txt file eliminates the time saved by using the vba code.


    Its probably stupid and easy but google hasn't been any help....

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: parsing text return space to space

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    08-30-2012
    Location
    nj
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: parsing text return space to space

    Im looking for the vba command "return all the data between the two spaces regardless of number of digits" i dont have the ability to grab a sample file.

    Just like saying =mid(5,*) where star is a wildcard... One that stops when it hits a white space.

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: parsing text return space to space

    This formula will return the part string between the first and the second space in a text string.

    Please Login or Register  to view this content.
    and you should be able to translate this into a VBA command.

    Personally I would probably use the "Text to Column" method with space as a delimiter and take the substring from the second column.

    Alf

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Lightbulb Re: parsing text return space to space


    Hi,

    see also Split function …

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Shift+Space and Ctrl+Space shortcuts intermittently working
    By yumyumdimsum in forum Excel General
    Replies: 8
    Last Post: 10-14-2017, 11:54 AM
  2. replace double space with single space within a range
    By erikd80 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-05-2011, 01:20 PM
  3. Parsing Text Separated by A Space
    By scotfitz in forum Excel General
    Replies: 1
    Last Post: 11-13-2008, 02:19 PM
  4. Return Text String Through 12th Space
    By Eddiegnz1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-18-2007, 06:45 PM
  5. Parsing a space delimited file into segments
    By robinsgate in forum Excel General
    Replies: 6
    Last Post: 03-18-2005, 06:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1