Closed Thread
Results 1 to 6 of 6

Printing spreadsheet results to a text file

  1. #1
    Registered User
    Join Date
    07-10-2008
    Location
    Gold Coast, Australia
    MS-Off Ver
    2007
    Posts
    14

    Printing spreadsheet results to a text file

    Hello,

    I'm trying to do something very simple, but I haven't had any luck searching for a function in excel that will let me do it.

    Column A is a list of directories on a server, i.e. 01april, 02april, etc.
    Column B is the path to those main directories, i.e. /raid0/data/documents/april/
    Column C is where users can can type "1" if they want the directory or leave it blank if they do not want it selected.
    Column D, if the corresponding row in column C=1, will show the complete source path/filename based on Column A and Column B.
    Column E, if the corresponding row in column C=1, will show the complete destination path/filename based on Column A and Column B.

    This is all working fine.

    What I want to be able to do now though, is somehow, when someone sends the document back to me, create an FTP queue. I can do this with BulletProof FTP, because it allows really simple text queues.

    So, what I need excel to do is, when someone has finished selecting their files, is write the results to a text file like exactly like this (without the Line1:, etc.):

    Line1: <text from D2>
    Line2: 0
    Line3: 0
    Line4: 0
    Line5: ?
    Line6: <text from E2>
    (then repeated for each row in the excel document until column A is returning blank)

    Seems simple enough.. Any ideas?

    Also, an extra question--> is there any way I can make Excel list a directory structure automatically? Could it display the file size for the entire directory? I don't necessarily want it to list every file, just the directory paths and size of each directory.

    Thank you!
    Last edited by cameronyoung; 06-22-2009 at 10:52 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Printing spreadsheet results to a text file

    You can create the ftp instruction file by using I/O commands.

    Please Login or Register  to view this content.
    Excel will not automaticaly create a detailed list of information about a directory. You can however use VBA to do it for you.

    This very simple routine will list all .xls files in a given folder.
    Please Login or Register  to view this content.
    If you really do require more information about a file you can use the FileSystemObject to search for files.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-10-2008
    Location
    Gold Coast, Australia
    MS-Off Ver
    2007
    Posts
    14

    Re: Printing spreadsheet results to a text file

    THANKYOU!!!!!

    Just one more question---how can I make the "MakeFTP" command *not* print to the text file if there is no "1" in Column C? (i.e. just move to the next row)

    THANKS AGAIN--AND FOR THE FAST REPLY!!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Printing spreadsheet results to a text file

    Andy,

    Might
    Please Login or Register  to view this content.
    better be
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Printing spreadsheet results to a text file

    Yes. No need to double up on the New syntax.
    I copied the declaration bit from a previous post and never noticed the 2 New's.

    Just add a conditional test,

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-10-2008
    Location
    Gold Coast, Australia
    MS-Off Ver
    2007
    Posts
    14

    Re: Printing spreadsheet results to a text file

    Thank you!!!

Closed Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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