Writing Results To A Text File

Jun 12, 2009

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.

View 6 Replies


ADVERTISEMENT

Writing To Text File Without Quotations

Aug 6, 2014

This code I am using writes cell data to a text file starting from A1 and going down the column. Each line/row is written in quotes. How can I disable or replace the quotes with blanks in the text file?

Here is the code:

[Code] ........

View 2 Replies View Related

How To Change Line When Writing To Text File

Feb 9, 2012

Set FSO = New FileSystemObject
Set FSOFile = FSO.OpenTextFile(textfullname, 2, True)
FSOFile.Write ("xx")
FSOFile.Write ("02022012")
FSOFile.Writeline ("Next line")

I am getting this in the text file:- xx02022012Next line

I want this: xx02022012 Next line

How to change line when writing to a text file?? the writeline is not changing line.

View 1 Replies View Related

#NAME- Error Results When Writing Formula To Spreadsheet From VBA

Apr 25, 2006

When I am writing a formula that includes a lookup, it returns the # NAME? error in the spreadsheet. If I delete the trailing ), retype it, and hit enter then the formula returns the correct value. How do I get the formula to work correctly as it is written to the sheet from VBA!

Here's the line of code that writes the formula to the worksheet:

TBox.Range("A3").Offset(i, 3).FormulaR1C1 = "= ROUNDUP((8-(VLOOKUP(RC[-3],K:L,2,FALSE)/1.2))/RC[-1]*1.2,0)"

View 4 Replies View Related

Printing Spreadsheet Results To A Text File

Jun 21, 2009

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)

View 5 Replies View Related

Bad File Mode: Writing To Locked Binary .txt File

Oct 6, 2006

I have a .txt file created in Notepad and it contains a 4 digit number (Job ID). I am recieving the dreaded "Bad File Mode" (#54) error when writing back the file.

I would like to OPEN it as R/W locked, read it, increment it by 1 and write it back. Am perfectly willing to create the .txt as non-binary if that is causing the issue.

Dim jinChar As String
fileNumber = FreeFile()
jinFP = "JIN.txt"
Open jinFP For Binary Access Read Write Lock Read Write As #fileNumber
Input #fileNumber, jinChar
jobIDNumber = CInt(jinChar)
jobIDNumber = jobIDNumber + 1
jinChar = CStr(jobIDNumber)
Write #1, jinChar
Close #fileNumber

View 4 Replies View Related

Writing The Contents Of Cells Into A File

Apr 12, 2009

I have a bunch of values in column A, and I need to write (export) the entire column into a file called "ColumnA.dat".

create an Excel Macro Script that would accomplish that?

View 9 Replies View Related

Prevented From Writing To The .xlb File On Closing

Sep 15, 2009

I'm making a workbook which I want to distribute widely. It will have a lot of changes to the menus which happen 'onOpen'.

I am keen to not spoil peoples special menu setups on closing the workbook.

If I understand correctly, on closing, Excel writes the current menu settings to the .xlb file. Does anyone know of a way to prevent it doing this so that peoples setups are left unchanged?

Presumably there is code that will do it but I've searched a long time and found nothing.

View 9 Replies View Related

Writing Batch File To Remove Spaces From Filenames

Oct 11, 2008

I realise this is not strictly an excel question but it forms part of my VBA code within excel

I have been writing a VBA program (with some fantastic help from you guys) part of which writes to a batch file to rename files stored in a given folder. Unfortunately this fails if the original files have spaces in the filenames. The batch file contains command lines such as: ...

View 6 Replies View Related

Excel Form Writing Filled Data To Another File Or Sheet

Mar 5, 2014

Currently I work on a file which will be more like a form which will be filled by user and after he or she hits the button, the filled data will be written or sent to another Excel file or even Sheet in the same workbook which will store the filled data in database like form. The same as some web form which will post the data to database.

In other words, the workbook contains to sheets, one with forms to be filled in (cells) and one with specified columns. After filling in the cells on the first sheet and hitting the button, it will trigger the macro which will send data to second sheet and post data from each cell to appropriate column.

View 7 Replies View Related

Writing To File May Require Special Print Statement Syntax

Jan 22, 2013

Code:
' write data to txt file
For j = 1 To 3
For k = 1 To 21
Print FNum, OPTOarray(j, k)
Next k
Next j

I am writing an Array to a text file but I keep getting an error that the Print statement requires a suitable object. I tried Debug but all this did was put the data into the immediate window and created a file that was empty.

"????.Print FNum, OPTOarray(j, k)".

The data in the immediate window is correct but when you open the text file with notepad there is nothing to be seen.

View 1 Replies View Related

Writing Text In A Cell

Jan 21, 2010

I have a problem, basically im writing in the cell but it keep going along, i want it so when i press enter it creates a new line in the cell, so i can have two lines of text in one cell. do i have to do something in the text settings?

View 2 Replies View Related

Writing Number As Text To A Cell

Jun 16, 2013

Process is that I read in lines from a text file and then based on a filter I then write some those values to a sheet. One of the values I transfer is always 5 characters with a trailing space. The first four may be all numbers (e.g. "0013 ") or a mix (e.g. "013G "). When I write these to the spreadsheet the ones without letters always end up as a number (e.g. "0013 " become 13). How do I force the cell to show all values as text in the cell just like I read it in. In fact, I'd prefer stripping out the trailing space but it's not critical. That I can do (TRIM).

View 4 Replies View Related

Difficulty Writing Code For Changing Font Color If Cell Contains Specific Text

Aug 11, 2009

I have a spreadsheet that will contain about 5-15 rows with a letter "S" in the column. If this letter S appears in the column, I need its entire row to change font color to RED and then change that row's value in column L to a negative number. is there any easy way to do this?

View 14 Replies View Related

Looping, Open Text File, Copy Text, Close Text File

Sep 18, 2009

I have an existing spreadsheet with a column of strings (actually VIN numbers). These numbers correllate to a bunch of text files, that can exist in one of three folders (UsernameDesktop1, 2, or 3) on my desktop. What I need the macro to do is:

1) get the filename from A2 (A1 is a heading row)
2) Find the appropriate text file in one of the three folders
3) Put the folder name into I2
4) Scan the text file for some strings, and copy some data that follows those strings into J2:O2 (I can handle programming this)
5) Close the text file
6) repeat above for the remainder of filenames (about 1800 files)

View 3 Replies View Related

Writing Specific Content From Excel To External File Of Specific Name

Apr 29, 2013

I have a worksheet that contains two basic columns of data, A and B. What I would like to do is based on the value in column A, I would like to copy the contents of column B to a textfile (preserving the basic line structure and hopefully without any extra characters like quotation marks attached). So for all the values in column A = 'Account', Id like to take all the corresponding values in Column E (for example) and save them to the same file, preferably where the filename itself as 'Account.xyz'. And I would like to do this for all unique values in Column A, that is do it for 'Account' and 'AccountPrivilege' etc. Note Column A is essentially presorted alphabetically already. There are actually 1000s of rows with hundreds of unique A values so Id like to find a way to automate this process.

A
B

1
Account
Company Information

2
Account
Company

[Code] ........

View 2 Replies View Related

Insert Text To One File - Remove Text From Equivalent Column In Another File?

Aug 13, 2013

Got a slight problem; I am making a "worker-plan", where you should be able to write a name on one file and have it updated (removed) from the equivalent columns on another file automatically. Here's an example with two separate projects:

Project 1 before and after changes:
Attachment 257366
Attachment 257367

Project 2 before and after changes:
Attachment 257368
Attachment 257369

You can see here how I intended it to work. When one worker is moved from Project 1 to Project 2, that worker should also be removed from those weeks in Project 1. The previous worker from Project 2 should also be removed from those weeks (in Project 2).

Are there any formulas that can make this work automatically? All week numbers will belong to the same columns in all files.

Edit: There are 30 files that should be syncronized, not just two.. I could also gather all files into one file with sheets, instead of having seperate files.

View 2 Replies View Related

Macros - Changin File Name Results In Bug.

Sep 30, 2008

I have a couple of basic macros that edit formatting in a sheet that I want to send out to various people. The problem is, when I change the file name of the worksheet - the marcos stop working as they refer to the actual original file name.

Could someone please advise if (I am sure it must be somehow) it is possible to emmend the Macros in some way so that they continue to work regardlesss of what the end user decides to name the worksheet.

View 9 Replies View Related

Drill-down Pivot Table Results In New File

May 15, 2007

I want Pivot Table Drill-down result in New excel file. when I have a pivot table, When I double click any data cell, the result comes in the new sheet(Drill-Down) of the same file BUT I want the same result to come in a New Book (a new excel sheet) and not in the same file.

View 3 Replies View Related

Automatically Apply 2 Filters For 2 Columns And Get Results Compiled In Single Excel Or CSV File

Feb 18, 2014

Use filter for 2 columns of a CSV file, column A and Column B for certain words. Say I apply a text filter: contains "word1" or contains "word2" to Column A. Then I get the results. After that, I remove the filter to Column A then apply the same filter to Column B. The thing is, I don't get the results in Column B, instead, I get the cells in Column A wherein Column B is filtered PHOTOS BELOW:

The data that I get for this filter are:
And Word1 you
Word2 is blank

Apply filter to Column B, get the cells filtered in Column A:

The data that get for this filter are from Column A (which are cells filtered from Column B filter)
And Word1 you
Is the blah
Word is all

The results should in a single Column for both filter:

I have more than 100 files that needs to filtered this way, is there any way I can do this automatically?

Here is what the file looks like:

The results I hope would be possible:

Automatically without having to open all the files and have the results of all of it in 1 single Excel file?

----or----

If the above is not possible, open each file and automatically apply the filter into a column in just 1 click and without having to type the same filter for each column.

I found a code to combine all CSV files into 1 Excel file, but half of my files has more than 500k rows and the Excel's limit for rows is around 1million+.

View 9 Replies View Related

Text File Import With Text To Columns Splitting Same Text Differently

Nov 21, 2007

I have a macro which imports data from a mainframe dump text file and performs 'Text to Columns' on the imported data so that formula in the spreadsheet can act on the data. The code works perfectly well when I use it, but if a different user logs on and performs exactly the same mainframe dump and import macro the Text to Columns action splits the raw data in a different way and the result is that the split renders the formulae useless.

I've experimented a little and for some reason it appears that the 'Field Info' parameters which are produced when the Text to Columns function is recorded in a macro differ between users even though the raw data is exactly the same.

FieldInfo:= _
Array(Array(0, 1), Array(18, 1), Array(35, 1), Array(56, 1), Array(70, 1), Array(88, 1), _
Array(102, 1))

View 6 Replies View Related

Putting Text At The End Of Formula Results

Jan 8, 2010

I'm trying to enter relatively simple drug calculation formulas in Excel where the result is appended with the proper units to administer. For example, if I'm calculating for units of regular insulin with a formula such as:

=0.75*f2

I'd like the cell to make the above calculation, and append it with "Units Reg Insulin" or something similar. Thus far, I've just been putting the units as text in adjacent cells but the result looks a bit messy.

Is this possible? I'm using Excel 2007 and the Help index does not seem to offer much guidance about this.

View 8 Replies View Related

Cell Housing Text Results In ####

Feb 16, 2008

As I type in text into Excel often I see number signs instead of the text. Baffling - I have tried switching the format to wrap etc - nothing works.


Can anyone help - See attached file. The short solution is to retype the text - but this occurs alot and I am not sure why. Really appreciate your help.

View 3 Replies View Related

Write VBA Code That Will Generate Text File With ALL Changes Made To Excel File

Jun 4, 2012

Is it possible to write vba code that will generate a text file with ALL changes that were made to an excel file. Ex. If Cell A17 = "Monday, June 4, 2012" and a user updates Cell A17 to "N/A", I would like to know what the value was before and after the udpate was made.

View 8 Replies View Related

Browse A Text File With 10 Textual Lines And Rewrite The Contents In The Same File

Feb 5, 2010

i want to browse a text file with 10 textual lines and rewrite the contents in the same file (starting from line number 11) from bottom to top.

View 9 Replies View Related

Import Text File Into File Where Rows Exceed Excel Row Limit

Jun 3, 2009

I have a workbook with many spreadsheet named Sheet1, Sheet2 and so on. Each sheet is filled completely upto 65536 rows. This data is being picked up from a CSV file. In this file there are sites with each site there is a assciated set of data. What happens is the data that extracts data does not differntiate between sites and when it reaches to the end of worksheet it splits the data into next sheet. So I am trying to create a macro to check each spreadsheet starting with the last sheet in the work book for example last sheet in the workbook is seven it should go to sheet6 and if there is a blank row after row 64000 it should cut all the rows and move them to sheet7. Then it should goto sheet5 and do the same and keep on doing it until it reaches sheet1.

View 9 Replies View Related

Changing Order Of Text Based On Results?

Oct 7, 2013

I've attached a spreadsheet. I want the order of the sentence to change based on the numbers and whether they are positive or negative. Below are more details and the spreadsheet has numbers.

"Total expense for September was 8 higher (lower) than prior year, driven by a higher (lower) claims expense and admin expense"

This might be hard to explain: For the second part (starting from "driven by", I would like the variable that explains more of the positive or negative variance (in the example, claims) to come first.

Here is a different example

Total expense for September was 6 lower than prior year, driven by a lower admin expense (claims is not included because it is higher)

View 8 Replies View Related

Return Text Results Based On 2 Criterion

Oct 6, 2008

I am attempting to create a formula that will, return text results based on 2 criterion.

This is what my sheet looks like

Name Job Full Time / Partime
Bob Admin Full Time
Barry Accounts Part Time
Chris Claims Full Time
Emma Claims Full Time

The formula I have for this is {=INDEX(A1:A4,MATCH(1,(((B1:B4)="Claims")*((C1:C4)="Full Time")),0))}

Which is fine and returns the name Chris, however as you can see from above, Emma also meets the criteria given however, I cannot get Emma to appear also. Is it possible to display more than one entry in a cell/s based on this formula, or am I missing something.

I would use a pivot table to do this, however I need the sheet to be completely automated.

View 8 Replies View Related

VLookup To Output Text Data Results?

Dec 24, 2013

I have a column with lots of tube station names. I have a look up table with the tube station name, and the possible lines that pass by that tube station.

One tube station may be covered by more than one tube line.

I am looking for a formula that will output every tube line that caters that one tube station.

first question, what is the best way to organise the data in my look up table.
Second, is a vlookup the best formula to achieve the output I want? i.e. Reflect how many tube lines cover each station

see table below: If the station name has only one tube line, Vlookup works fine. When the station, such as Canno Street, has two tube lines, Vlookup only picks up one tube line. If I duplicate Cannot street under the station name, the Vlookup picks only one tube line.

LOOK UP TABLE A1 - station name
B1 Tube line name
Cannon Street
District

[Code].....

Is there a formula that will output the data of the second tube line name in column D1?

View 3 Replies View Related

Macro Putting In The Formula As Text Instead Of Results

May 28, 2008

My macro contains a VLookup formula that is giving me the text of the formula instead of the results. A portion of the macro is, as follows:

Sheets("Survey Results").Select
Range("c1").Value = "Resolving Group"
Range("c2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],'Survey Invitation'!C[-2]:C[-1],2,FALSE)"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C900"), Type:=xlFillDefault
Range("C2:C900").Select
Range("C2").Select

The VLookup statement appears in place of the result when the macro is run. This is Excel 2007 and it runs to the end without error.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved