+ Reply to Thread
Results 1 to 8 of 8

VBscript to stop selection at "-----Original Message-----" plus change ";" in the output

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    Orlando, Fl
    MS-Off Ver
    Excel 2007
    Posts
    65

    VBscript to stop selection at "-----Original Message-----" plus change ";" in the output

    I'm trying to select text. The following script format does that but some, not all, have the line "-----Original Message-----"
    I want to separate the text so that the script only selects up to the line "-----Original Message-----"
    plus if possible get the resulting ";" in the output to show up as actual line breaks
    using the following script format


    Original text
    Please Login or Register  to view this content.
    I realize that this Script grabs the entire text but

    Please Login or Register  to view this content.

    produces

    Please Login or Register  to view this content.
    But I want it to produce
    Please Login or Register  to view this content.
    This is not for excel but any advice would be great
    Excel 2010

  2. #2
    Forum Guru
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,887

    Re: VBscript to stop selection at "-----Original Message-----" plus change ";" in the outp

    5B:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-30-2012
    Location
    Orlando, Fl
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: VBscript to stop selection at "-----Original Message-----" plus change ";" in the outp

    wow so short and it works thanks

    is there a good place on the net to learn this stuff?

  4. #4
    Forum Guru
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,887

    Re: VBscript to stop selection at "-----Original Message-----" plus change ";" in the outp

    You are welcome, thanks for the rep.points.

    I think almost all of us learn things like this from everywhere, from the Excel help file, from googling for specicific problem, from examine solutions provided by others on forums like in here. I believe there is no "good place" to learn all of the things, we have to search the information from everywhere.

  5. #5
    Registered User
    Join Date
    08-30-2012
    Location
    Orlando, Fl
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: VBscript to stop selection at "-----Original Message-----" plus change ";" in the outp

    Any chance you would help me with this one its a bit more complicated.

    Original text:
    Please Login or Register  to view this content.
    This script selects it correctly
    Please Login or Register  to view this content.
    produces:
    Please Login or Register  to view this content.
    I'm trying to order them chronically
    my true purpose is to have them chronically ordered in a format that can be exported to a file name, That means / and : can't be used
    So I'd like for it format to military time starting from the year.

    Result
    Wed, Apr 26, 2017 at 1:10 PM
    becomes
    2017-04-26-13-10

    year-month-day-24hour-minuet

    thanks

  6. #6
    Forum Guru
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,887

    Re: VBscript to stop selection at "-----Original Message-----" plus change ";" in the outp

    Like this ?
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-30-2012
    Location
    Orlando, Fl
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: VBscript to stop selection at "-----Original Message-----" plus change ";" in the outp

    Error Source: Microsoft VBScript compilation error
    Error Description: Expected end of statement
    Error on Line: 2
    Error on Column: 10
    Error in String:" Dim v As Variant"
    2017-05-01 14_50_34-Script Editor.png

  8. #8
    Forum Guru
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,887

    Re: VBscript to stop selection at "-----Original Message-----" plus change ";" in the outp

    When I was reading the title of your thread : 'VBscript to ...', I think what you mean is 'VBA Script' (lot of people ignore the 'A') which is the programming language of Excel.
    It is obvious now that you really mean 'VBscript', not 'VBA script'.
    In this case, you are in the wrong forum.
    This forum is discussing topics of Microsoft Office's products (Excel, Word, etc) only.
    You must post the question on some other forum that is dedicated for VBscript.
    Please do not posting anything that is not related to Microsoft Office on this forum anymore.

    Anyway, this is VBS file that answer you question :
    Attached Files Attached Files

+ 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. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. [SOLVED] Force "Read Only" only in original spreadsheet - NOT in resultant "saved as" spreadsheets
    By xdrenched in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2016, 01:11 PM
  4. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  5. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  6. MSoffice Outlook 2003 message to be saved in C dir with the file name "From" "Sent" "Sub"
    By shailendra0509 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2012, 01:32 AM
  7. Replies: 3
    Last Post: 10-25-2005, 07:05 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