+ Reply to Thread
Results 1 to 6 of 6

Write Sub procedure to format excel and write case/if statement to text file

  1. #1
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Write Sub procedure to format excel and write case/if statement to text file

    How can I take this excel file below and output to the text file format
    with Case statement and if statement?

    'TRIPID' SEQUENCE SCHHWY
    '2005708' 1 18
    '2005708' 2 18
    '2005708' 3 18
    '2005708' 4 17
    '2005708' 5 16
    '2005708' 6 16
    '2005708' 7 16
    '2005708' 8 15
    '2005708' 9 15
    '2005708' 10 15
    '2005708' 11 15
    '2005708' 12 15
    '2005708' 13 15
    '2005708' 14 15
    '2005708' 15 15
    '2005708' 16 15
    '2005708' 17 14
    '2005708' 18 14
    '2005708' 19 14
    '2005708' 20 14
    '2005708' 21 15
    '2005708' 22 14
    '2005708' 23 13

    Output TextFile below.
    Please Login or Register  to view this content.
    Last edited by alansidman; 04-05-2018 at 05:30 PM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: Write Sub procedure to format excel and write case/if statement to text file

    Are you asking how to write Select Case statement?

    Upload a workbook and the text file that you want after the macro.

    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 then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Write Sub procedure to format excel and write case/if statement to text file

    Yes, I do need a Select Case statement in Crystal Report Syntax.

    Please see attachments

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: Write Sub procedure to format excel and write case/if statement to text file

    This is just a rough idea about the output.
    You need to check it and comment...
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-16-2018
    Location
    Austin Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Write Sub procedure to format excel and write case/if statement to text file

    Excellent! Thank You jindon!

    vbronton

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: Write Sub procedure to format excel and write case/if statement to text file

    You are welcome.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] Write a text file into excel
    By Stefan22 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-23-2016, 06:38 AM
  2. can you write an excel statement with text to read from another cell?
    By Lmomma in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-19-2016, 05:35 PM
  3. Using VBA to write Excel data to text file
    By Olly in forum Tips and Tutorials
    Replies: 0
    Last Post: 04-08-2014, 05:19 AM
  4. [SOLVED] Using ADO to write to an Excel file - Type Format
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 03-25-2014, 06:55 PM
  5. How to format a code to write values to create a text file?
    By DakotaRoss in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2013, 09:13 AM
  6. [SOLVED] Open CSV file, format data and write output to a text file.
    By BristolBloos in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2005, 11:05 AM
  7. [SOLVED] Write Procedure With Logic Test To Open File From Given Directory
    By Carl Bowman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2005, 11: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