I have the following code (borrowed) which converts the current .xls worksheet to a tab-delimited .txt file. The problem is that i need to add a PIPE to the end of each row/record as well, so that the records would look something like this:
A|123|
B|456|
currently there is no PIPE following the last character (3 or 6) and i am getting this:
A|123
B|456
I was hoping there would be a way to revise the VBA to add a PIPE at the end of each row/record.
I have the following code (borrowed) which converts the current .xls worksheet to a tab-delimited .txt file. The problem is that i need to add a PIPE to the end of each row/record as well, so that the records would look something like this:
A|123| B|456|
currently there is no PIPE following the last character (3 or 6) and i am getting this:
A|123 B|456
I was hoping there would be a way to revise the VBA to add a PIPE at the end of each row/record. Here's the ...
Figured out how to export to Pipe Delimited through coding but now I am faced with 2 complications.
1) The column order in the EXCEL file is not the Order I want it to Export in. (i.e. COB Date maybe in Column 'I' in the Excel File but when I export it into .txt I need it to be in the First Column)
2) I need to have the header name Changed in the .txt file (i.e. COB Date is the name in the EXCEL file but I need it to show as cob_date in the .txt file)
I have a string of data coming from a SQL Server data connection into my workbook. The value in the column is a text string that is pipe delimited. I need a macro to parse the data from that column into applicable separate columns. I would typically use text to columns for this and parse it out manually... but the tool I'm creating is one of the automated variety, so that will not suffice for this application. I need it to do this automatically when the data connection refreshes.
U:U AQ AR AS AT AU AV to Produce|Fruit|apple|banana|cherry|date Produce Fruit apple banana cherry date
how to word it but if someone understands then please help. I have two excel data files namely Book1.xls & Book2.xls. Both files have different data in it. Both files contain macros. When these macros run the files become **FINALIZED** version.
Originally, I get the above files in my email as txt. attachments. I then move these two txt files to my desktop in a folder called Folder-1. Then I open these files as an Excel and save them.
Basically, I need to know if two txt files are sitting in a folder-1 on my desktop. What can I do or what can I clik that....those two text files get converted into excel automatically, including running that macro I talked about in the above paragrah.
To put it differently, if I have two txt files Book1.txt, Book2.txt in a folder, how can I automatically create an excel **FINALIZED**version which sits right next to their txt version.
I attached a txt file of a report we get out of our accounting system. It is not tab deliminated, when I open it in excel, each whole row is contained in 1 cell instead of being broke up into columns. Im not sure how to convert it, im sure it possible using vb or something?
I have a software package that requires serial number effectively data to be entered in a particular format.
As this can cover hundreds of lines I would like to make it less tedious to enter, and as my MACRO knowledge is very basic.
The data starts off in format below in example 1. After the data is CUT from the .html or .pdf document and PASTE into EXCEL. I would like the MACRO to start by pressing an activate button within EXCEL,
The serial numbers always have four digits with single serial numbers being separated by spaces and ranges being separated by a hyphen with the odd carriage return depending on how many numbers there are.
I would like the data to end up in two separate columns as shown in example 2.
Example 1 (Starting format) * indicates space - indicates a range, this needs to be separated into two separate columns
I have tried to alter some existing code from this site to accommodate my needs with no luck.
I would like a macro to convert the following.
Column A1-C1 contains Headers Column A-C contains Simple data to be copied down as many rows as needed to match the number of delimited pieces in the following columns. Columns D-I contain Data delimited by 3 spaces. The number of delimited pieces of data can be different in each row. The number of Delimited pieces of data will be the same in each column of a particular row. Example: if D4 has 4 pieces of data separated by 3 space, E4 will also have 4 pieces of data separated by 3 space, F4 will also have 4 pieces of data separated by 3 space and so on to I4.
D5 may contain 5 pieces of data separated by 3 spaces through I5 all containing 5 pieces of data.
Column G may contain a single space within the data delimited by 3 spaces.
Columns D-I may only have 1 piece of data with no delimiter.
I would like the Delimited data to be split apart and a new row created for each piece of data. and copy the corresponding data in column A-C to each new row.
If this can be done in the same worksheet or copied to an existing worksheet that would be great.
Here is a link to a sample on Google Drive [URL]
I am using Excel 2010 but would like it to be compatible with 2003 as well.
As I mentioned I found some VBA to do what I need but it only does 4 columns and I cant figure out how to make it do the 9 I need.
{= SUM(IF(({325,481,342,440,425}=ID)*($A37=DateRng)*1, ROUND(Sales,2),0))} I am currently using this formula to retrieve total sales by day for each team and it works perfectly. Data is stored in columns by Date,Salesman ID,Sales.
I would like to replace the array portion with a vlookup to return the array set so i can use drop-down to select different teams and see the sales for that team.
{=SUM(IF((vlookup(TmName,Teams,2,0)=ID)*($A37=DateRng)*1,ROUND(Sales,2),0))} This is the function as I thought it would work, but the vlookup returns "325,481,342,440,425" as a string not an array.
I have a list of terms in a spreadsheet. Assume they start in cell A1 and they descend down for the next 300 cells. Basically I need to pull those terms into a single text string where the terms are comma delimited.
What I have been doing is concatenating them so they all end with a comma, copy them 25 at a time, pasting values and transposing then running a concatenate formula for the 25 terms. Do this 10-15 times to create that many comma delimited lists then concatenate those lists to create one all in one list.
Example:
The list (starting in A1) looks like this: Dog Cat House Car Boat Mom Dad
but I need: Dog,Cat,House,Car,Boat,Mom,Dad
If possible to do this with a formula please do so as my knowledge of using VBA modules is limited but if this must be done using VBA please realize that I'm in the thrid grade compared to your knowledge so please explain how to implement the module as clearly as possible.
I'm trying to create a excel sheet with macros that will generate a tab delimitd file which is a journal voucher and I want to upload that .txt file to our financial system (SAP). When I create a tab delimited file manually, that is I enter all the values in excel and save as .txt it works great. But I have created a spreadsheet where the useres (all employees on the financial departement) enter the info required. I have a macro validating that all fields are correct and so on.. When they are finished they sedt the spreadsheet to me (an excelfile) via email, this is done by a submit buttom(macro) and the I have a hidden sheet in the worksheet which gets all the values that are necessery and then I create my tab delimited file using the well known save as fileformat=xltext macro. But SAP will not accept this file. I get error messages as convertion erros in line 4 column 6 and so on. The sheet which is saved as .txt is 100% with formulas, it gets all the value from another sheet(sheet1). I use the formula =IF(Sheet1!$E17=0;"";Sheet1!E17) in the cells with E17 changing to whatever cell is required. What can be wrong here? May it be that all the formulas (columns A to H and row 2 to 1001) somehow mix it all up and even to the cell is empty is the formula is somehow hidden in the .txt file and that messes it all up??
I am trying to open up an asterisk delimited file then shrink the data, then after I want to save it back as an asterisk delimited text file. How would this be done in vba, as well as manually?
I've a word form that collects free text and tick boxes. I'm reading these into separate rows on an excel sheets. So far what works...
I've got excel vba converting the word to a delimited text file I've got excel vba to remove the erroneous rtns that people have entered into the free text that was things up.
In the free text there are commas entered as well as the tick boxes and this is a csv. Example "how do I do this, I don't know",1,1,0,1,"really seems to be a challenge!"
If I just use excel to open the text file then the columns work out ok and on a single row - I think the 'text qualifier' is playing a role here.
But I can't replicate this in VBA. If I record a macro it's a query table and I don't know how to amend the code to read into rows.
I have a work sheet with some names address, and phone number in it... I need to save it as a CVS file (comma delimited) easy right??? WRONG!!! everytime I save it, it takes the phone number column and shortens it AND turn the phone numbers into a mess
What it looks like NOW 9057926500
What is looks like after save
9.06E+09
If is make the column bigger it goes back to the "good" numbers, but when I save to a CVS it goes to the "bad" number.
In my workbook I have 10 columns with data, starting at A12 and down. This could be several hundred rows. I would like to export the first three columns only (Column A, B and C). The TXT file should have the following: First line: "This file was exported from Excel" Second line: The value of cell B4 of the worksheet Third line: The value of cell B5 of the worksheet Fourth line: Today's date ( as 27/Sep/2007) Fifth line: No entries (Empty row) Sixth line will be the first numeric transfer. This is cell A12 value, cell B12 value and cell C12 value. Seventh line: Cell A13 value, cell B13 value and cell c13 value. etc, until the end or selected amount of rows. The values of the different columns should be separated by commas Column A values could be 9 characters (5 numerics with 4 decimals - 12345.6789) Column B values could be 10 characters (6 numerics with 4 decimals - 123456.7890) Column C values could be 10 characters (6 numerics with 4 decimals - 123456.7890)
The text file therefor would look as follows:
This file was exported from Excel. Company ABC On this continent 27/Sep/2007
I tried to adapt jindon's code but no luck. I am currently doing it the long way. ='[Workbook1.xls]MySheet'!$A12&", "&'[Workbook1.xls]MySheet'!$B12&", "&'[Workbook1.xls]MySheet'!$C12 This works but I really liked what jindon did and wondered if it could be adapted to fit my needs.
am in a time crunch to write VBA code(not use the macro recorder) to do the following:
Input data from a tab delimited Text file into a pre-formatted sheet.
Each column of the text file is as follows (product code, buy/sell, quantity, price, date) Example row below.
YM Buy 50 12800 1/2/2008
Is there code I can use to do this? I need each individual piece of data to import into it's own cell while keeping the Row/column alignment of the original text document.
I'm using Excel 2000 swedish version, that is we use comma to seperate decimals not dot. I have a macro that saves a sheet as .txt file (tab delimited). However in the sheet (journal voucher) I need to enter a couple of numbers all with 2 decimal, that is 5 is 5,00 and so on. But then, when I save the sheet to a .txt file using a macro all the commas are saved as dots and since I'm importing the file to SAP it will not accept the dots. Is there some way ( changes in macro) I can prevent the commas from becoming dots when I save the .txt file?
I have a text file, which has a column of wrong data. I can change it manually by loading it into Excel but it is semi-colon delimited and I can't export to such a file.
I therefore, would like to write a VBA tool, which reads the file and edits the the value between the 5th and 6th semi-colon and will continue do this for each row (the new value is constant across the rows).
I need to summarize some data from multiple files but I can't seem to have the user select the file and import it.
It's a ERA(electronic remittance advice) 835 file that will import with the "Import Text File" routine. I've added the "GetOpenFileName" to it but apparently have not appropriately adjusted my "QueryTable.Add" routine.
I removed the .Refresh Backgroundquery:=False line as this was causing an error and this not SQL data.
The desired files have names like this: C123456.835.EDIPROCESSERPROCEEDED
My simpleton code reads:
Sub IMPORT_835() ' IMPORT_835 Macro Dim InputFile As Variant
InputFile = Application.GetOpenFilename(Title:="Choose your file", _ FileFilter:="All Files (*.*), *.*")
I am trying to save a worksheet as a txt file. The worksheet has a range of data with a variable amount of rows in column A only. It generally will look like:
where each row of data is in a single cell.Whenever I save it, however, it adds extra tab deliminations in each row after the data, and it adds rows with no data (sometimes just 1, sometimes many).
I am positive that no cells in columns B-n have data in them (even just a space) and no rows after the last intended have data.
Why are these extra rows and columns being inserted? How can I save a txt file that literally has no other spaces or rows or deliminations other than what's intended?
I was wondering if their is a simple macro to transpose data from rows to columns so I can export to a tab delimited file. This particular list is 5 lines underneath each other and then the next entry.
providing a macro to save an excel sheet to comma delimited txt file. Also, My sheet has 1st row as table columns and i dont want to export them in my txt file.
I would like to be able to execute a command line that will convert an Excel csv file to an Excel file that is TAB delimited. In other words, replace the comma delimiter with a TAB delimiter without having to open the file in Excel. I am an inexperienced Excel user
I want macro which export each excel column to new text file. The data in excel file is number. The column has only 5 rows that means each new text file should contain five lines of one column. It looks simple but couldn't manage to do macro for it. I have very big data set in one excel file, and have to be splitted into text files. The file name in new text files can be any kind as long as it can be in some sort of order for each export.