Prevent Text Being Split Down Rows On Import
Nov 22, 2007
I have a large sheet that I am having some problems with. The information comes from our database. In column A I have a client code and other information over to column D. In columns E I have dates. These dates have comments that are associated with them entered in column F. The problem is that sometimes these comments wrap into the next cell below. I have done this in the past. But the problem is that in column G there are dates of when the action took place, the issue is that there might be 1 or 10 of these dates per client. And then in Column H there are comments as well that spill into the next cell below.
What I need is to have everything in the first line, the client code over to column E, Combining of the cells in column F that were broken over multiple cells, then in Column G the first date and its combined actions to the right. The next row might have no client code but might have another date in Column G and comments in column H.
This is really hard to explain what I am looking for exactly. I have attached a small file that has an example of what might be downloaded and then a sheet of what I need it to look like when it is done.
View 8 Replies
ADVERTISEMENT
Jun 28, 2008
I need to format an Excel spreadsheet into a comma delimited text file. I have saved the file as a text file, I have suceeded at making it comma delimited. In the text import wizard I have also selected no text qualifier.
However when the file is imported everything works fine but some quotation marks pop up at the beginning and at the end. The quotations are not part of the file and I have already chosen no text qualifier. How do I get rid of the quotation marks so that they do not appear when the file is imported?
Attached is a sample of the file.
View 3 Replies
View Related
May 26, 2009
I have requirement to extact data into a spreadsheet. This data is extracted from CSV file which is huge normally over 7MB. I have found a macro on the internet which I have included with this post.
Sub split()
Dim ResultStr As String
Dim FileName As String
Dim FileNum As Integer
Dim Counter As Double
'Ask User for File's Name
FileName = InputBox("Please enter the Text File's name, e.g. test.txt")
'Check for no entry
If FileName = "" Then End
'Get Next Available File Handle Number
FileNum = FreeFile()
'Open Text File For Input
Open FileName For Input As #FileNum .................
I have also included reult data that I get after running the macro. I have cut down on data due to attachement restrictions. But usually there are multiple spreadsheets named "Sheet1, Sheet2, Sheet3 and so on". I have numerous requirements. First of all I want to be able to spreate data into columns. For now how I do that is by going to data -> text to columns and then selcting delmited and then selecting comma as my delimiter. Second thing I want to do is is only extract range of data from this output into a new worksheet. I am only interest in the name like for example ALBANY-Serial0/0/0 and data that is in the range of 8:00 AM to 6:00PM. So the new sheet should only have name and for that name data in the range of 8:00AM to 6:00PM for all the sheets "sheet1, sheet2 etc" until all data has been extracted.
View 7 Replies
View Related
Sep 26, 2007
I have a variable list. Each column will be 250 digits and numbers of rows will be variable. I want a macro to import a text file from a specific folder into a sheet without split it to columns. So we will work only in column A
Then macro will find B1002 wording in A1. if it is exist, it will copy the next 36 digits after B1002 wording if not then it will search A2 row. The next step will be to search and find another wording "B1001" if it finds it will replace copied 36 digits text. If it can not find B1001 wording it will go to upper row and search B1001 wording here and paste the text. This will go on till row shows #END. This means it reached the end of the list. And then macro will save this file as text file to another folder.
So macro will go to beginning to open other file in the folder and this will go on till last file in the folder.
This is the logic of the macro. Here is the sample of what I want.
Original Data: ....
View 9 Replies
View Related
Oct 7, 2013
I have an Excel sheet with 2 columns : Date and TextColumn
The TextColumn column contains in each cell text such as this :
Title1
TextLine1
TextLine2
Title2
TextLine3
TextLine4
....
I need to split each line as follows : Each title (in bold and on a new line) and the text who follows should be placed in a new row, copying the date in each new row created.
View 1 Replies
View Related
Jan 10, 2013
I have a text file that contains two rows of data for a single record. when I open the file up in excel, it puts each row into column A. What I need to do is put the 2nd row and combine it with the data in the first row so that i can then run the text to columns wizard and put all the data into its own column.
Here is an example of the data:
TEWAC Dresser Rand SAB 21120-14 1350 1687 3300 80 .80 50 4 2.63 EE-7592 1 2250 46 30.5 14 6
10 12 1 4 .229 .102 2 2 .0303175V/1 HL2 .13 .50 .25 1.5 394 3.000
IP23 Andalas SAB 21000-28.5 1500 1875 415 80 .80 50 4 4.22 EE-7777 80/50 Rise 1 2250 43 30.5 28.5 10
2 13 4 8 .258 .102 0 0 3175V 2 .11 .46 .25 1.5 1.500
CACA Intergen CACA 21120-33 1720 2150 6600 70 .80 50 4 4.56 R971055 50C Amb EE-7467 1 46 30.5 33 14
8 14 1 2 .229 .144 2 2 .0303175V/1 HL2 .20 .65 .30 2.0 697 2.150
What it should look like is the following:
TEWAC Dresser Rand SAB 21120-14 1350 1687 3300 80 .80 50 4 2.63 EE-7592 1 2250 46 30.5 14 6 10 12 1 4 .229 .102 2 2 .0303175V/1 HL2 .13 .50 .25 1.5 394 3.000
IP23 Andalas SAB 21000-28.5 1500 1875 415 80 .80 50 4 4.22 EE-7777 80/50 Rise 1 2250 43 30.5 28.5 10 2 13 4 8 .258 .102 0 0 3175V 2 .11 .46 .25 1.5 1.500
CACA Intergen CACA 21120-33 1720 2150 6600 70 .80 50 4 4.56 R971055 50C Amb EE-7467 1 46 30.5 33 14 8 14 1 2 .229 .144 2 2 .0303175V/1 HL2 .20 .65 .30 2.0 697 2.150
leaving me with 3 rows and one column of data.
I have multiple files with about 600 rows in each that I need to process.
View 2 Replies
View Related
May 23, 2012
I have a .txt file (comma separated) that updates daily, which I need to import into Excel. The .txt file contains data from many years, but I only need the data from 2012. Is there a way to only import rows where the data in column "yearID" equals 2012? Since this is a daily operation, I'd rather not import all the rows and then sort/delete rows every time.
View 4 Replies
View Related
Oct 25, 2006
i am importing a large number of text files from a folder into an excel worksheet (into column A) and found the following code from searching the forum.
Sub Import_Text_Files()
Const PATH = "C:Documents and SettingsSilent BazMy DocumentsElectronic Gift Card WorkTestTextFolder"
Dim My_Filenumber As Integer
Dim My_File As String
Dim My_Data As String
My_File = Trim(Dir(PATH))
If My_File = "" Then
MsgBox "No Files found matching " & PATH & My_Extension
Exit Sub
End If.......
View 9 Replies
View Related
Apr 23, 2008
I have a several large delimited text files around 800,000+ lines. It cannot all be pasted into excel due to the 65,000 line limit. For my purposes, I only need about 1 in every 1,000 lines from the text file anyways. Is there a way to only bring in the lines I want? Here is the test file layout:.................
I only need the lines that start:
"01","001","------"
I tried running some macros that I found through searching the forums, but I couldn't get any to work.
View 3 Replies
View Related
Jul 3, 2014
I want to split the contents of a single cell(ALT Enter as delimiter) into multiple cells and retain the values in column B.
Ex:
A1: apple
banana
car
house
A2: yellow
B2: building
x
y
B3: O
Output:
sheet 2:
A1: apple B1: yellow
A2: banana B2: yellow
A3: car B3: yellow
A4: house B4: yellow
A5: building B5: O
A6: x B6: O
A7 B7: O
View 9 Replies
View Related
Dec 1, 2008
I have a string of text in one cell on Sheet 1 (ie., A1, Sheet 1), here is a excerpt:
A-dec International Inc., A. Bellotti, A. DEPPELER S.A., etc ...
What I need to do is split the cell into separate rows, using the comma as a delimiter. I will be reading the cell from another sheet and need a formula that will provide me with
A1: A-dec International Inc.
A2: A. Bellotti
A3: A. DEPPELER S.A.
View 9 Replies
View Related
Jul 30, 2009
I have a Table in my schema (Oracle Database) that has about 250,000 records (rows in excel speak), and we use Excel 2003 at work, so I can't import this there and then split it by Store Number (column).
Each Store number has less than 65K rows, so it should fit into a sheet.
Has anyone written some VBA script that will be able to look into my SCHEMA, and the Table in question (specific name) and then split it by Store number and import each store to it's own sheet.
So if the Table has 20 stores, there would be 20 sheets inside the workbook.
View 9 Replies
View Related
Apr 10, 2014
I have around 50 text files with similar design per attached file. I need to import the text files with criteria below:-
1. include file name
2. let user choose the folder
3. exclude data from "work in process summary" to "work in process cost totals"
4. only have one title in the excel files which all text files is combined "Item, Line ....."
5. If the text files do not have title like "Item, Line, ..." do not import
Is it possible to have all criteria listed above by running a macro?
A.txt
View 1 Replies
View Related
Apr 5, 2012
I have a log that I regularly use to import text files, after each text file import it leaves a large number of rows blank that I have to delete before I add in the next text file import.
Any VBA method to detect this and remove the blank rows so that I dont have to keep checking to remove?
View 3 Replies
View Related
Jan 19, 2010
After doing some searching I found a macro here which imports multiple text files into one workbook, keeping each text file as a seperate worksheet, each worksheet named the same as the original file name (minus the .txt extension).
However, it adds a blank line between each line of text. So I get this:
Pinging 172.27.133.29 with 32 bytes of data:
Reply from 172.27.133.29: bytes=32 time=232ms TTL=62
Reply from 172.27.133.29: bytes=32 time=62ms TTL=62
Reply from 172.27.133.29: bytes=32 time=65ms TTL=62
instead of this:........
Pinging 172.27.133.29 with 32 bytes of data:
Reply from 172.27.133.29: bytes=32 time=232ms TTL=62
Reply from 172.27.133.29: bytes=32 time=62ms TTL=62
Reply from 172.27.133.29: bytes=32 time=65ms TTL=62
This doesn't happen when I use the import wizard, or when I just open the file from the File -> Open menu.
My text files are always the same format (number of lines, etc.), so it's easy to delimit and insert forumlae as needed, but those extra lines are breaking a macro I've previously written to parse the data.
View 9 Replies
View Related
Jan 29, 2008
I'm attempting to import around 200 (and growing!) separate text files into Excel. I am using the formula below to import the text file and then using a separate macro to select the information I need, copy it into another spreadsheet, and then run the import macro again.
However, I have a problem in that my import macro gives me 'Run-time error '1004:
Application defined or user defined error''. At first this wasn't a problem as the information is pasted into the spreadsheet despite the error anyway. However, now that I am looping the macro it is obviously causing more problems as it prevents the loop. I would really appreciate it if anyone knows of a work-around or can spot an error in the coding to resolve this!
The code below shows is for the import macro only:
Sub ImportTextFile(FName As String, Sep As String)
Dim RowNdx As Long
Dim ColNdx As Integer
Dim TempVal As Variant
Dim WholeLine As String
Dim Pos As Integer
Dim NextPos As Integer
Dim SaveColNdx As Integer
View 8 Replies
View Related
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
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
Feb 9, 2013
I would like to have my macro code search column A (supplier numbers) and split the rows into groups of rows of 5 or less and then insert 3 blank rows between each group of rows. The split needs to start on a new supplier number and cannot split a supplier number into two different groups. Here is a sample:
Supplier
Invoice Date
GL Date
Invoice Amt
[Code].....
View 1 Replies
View Related
Apr 8, 2014
I have the cell data as below
How would I split into a new column the first part which is a date into a new column, then the country and the remainder into separate columns?
I still want the original data as I need to check that the splits worked well?
16.5.90 CH 1671/90-4
18.10.1991 CH 3056/91-1
24.07.92 ch 2341/92-2
30.7.92 ch 2395/92-3
18.11.92 Us 3533/92-5
26.5.93PCT 1577/93-0
9.8.93 CH 2363/93-8
17.8.93 CH 2445/93-0
25.1.94ch209/94-6;8.12.94ch3714/94-1
25.1.94 ch 209/94-6 ; 8.12.94 ch 3714/94-1
8.4.94 ch 1047/94-0
22.4.94 ch 1255/94-7
18.11.1992 CH 3533/92-5
18.11.1992CH 3533/92-5
View 2 Replies
View Related
Mar 15, 2005
I'm trying to take a large text file and break into smaller text size files. I want to open the data file, and parse into 5000 line smaller files.
Here is what I have based off of some MS KB
Sub LargeFileImport()
'Dimension Variables
Dim ResultStr As String
Dim FileName As String
Dim FileNum As Integer
Dim Counter As Double
Dim CounterMax As Double
Dim sPath As String
Dim FileCounter As Double
'Output File
View 9 Replies
View Related
Jun 17, 2008
I am trying to write a micro code to split text which is copied into cell A1 into columns. I can do this fine by going to "data" the "text to Columns" and selecting the places i want to split the text (this is the same for every piece of data i copy in).
The macro works perfectly every time. the problem is that the spreadsheet is shared and i want to protect certain cells on the sheet, when i protect the sheet the recorded macro does not work as the "data", "text to columns" is not available in a protected workbook.
I was just wondering if someone could help me, so i can run a macro to split the text which also allows me to protect cells. In the "text to column" option the "fixed width" (column breaks) i choose are: 4, 25, 34 and 43.
View 11 Replies
View Related
Jan 9, 2007
By adapting a worksheet macro obtained previously via Ozgrid, I built a workbook that dynamically produces a database, in a worksheet titled “NumLtrWBS DB”, based on all possible combinations of what is listed in column A of three 3 worksheets titled: “ Num”, “Ltr” and “WBS, respectively.
The macro, named “NumLtrWBS", works wonderfully, until I add a row at the top of each list to contain a column header. The unchanged macro includes the column headers in the “produced” database. When I change the macro by altering the variable definitions to begin at A2 rather than A1, it still includes the column headers in the “produced” database. How should I change the macro so it doesn’t “produce” the column headers in the database worksheet?
View 3 Replies
View Related
Jun 11, 2013
I am putting together a macro that takes hours worth of work away by doing all the calculations and splitting.
I have managed to do all the basic stuff but this is a little more complicated.
My spreadsheet has a couple of thousand rows of data, i need the macro to check for the following:-
If DATA14 (Column N) = YES and RATE (Column D) = 21.81
I need this line splitting into two to replace the original. (would be better if i could move the original data to another sheet to show the ones that have been split)
One with 87% of the rate
One with 13% of the rate (Data8 will always = OLHA on this row)
Then the total will be recalculated based on the new rate.
View 1 Replies
View Related
May 21, 2009
What is the easiest way to stop users inserting new columns or rows into a workbook? Is it a case of protecting each sheet individually?
View 6 Replies
View Related
Nov 10, 2005
I have formulae in cells to reference another sheet, but if the referenced cell is blank, then the new cell I made blank (using the IF function). The problem is, when I want to print, Excel wants to print all of the cells with entries in them - even the ones with formulae in them that are blank.
Is there any way to prevent the empty cells from printing?
View 11 Replies
View Related
Mar 18, 2008
I have a form on a SheetA wherein all cells are referencing the data in cells on SheetB. When I delete or add a row on SheetB, the cells in that row on SheetA read REF#. I need the row in SheetA to be added when I add it in SheetB and vice versa for when I delete a row.
View 5 Replies
View Related
Jun 6, 2007
In column A i have a range of dates
In column B i have a range of descriptions
In column C i have formula which calculates an interest figure based on the date entered in column A and a date entered in a cell elsewhere. It also makes the cell display a couple of different strings of text if conditions are not met e.g. It displays "too early" if the date entered is more than 4 years before the date entered in the cell elsewhere
The problem that im having is this:
When i try to calculate column C i want it to throw an error if there is anything but a numeric value in the column. But it is obviously considering the cells in column C with for e.g. "too early" as a "0". I have tried all sorts of formula to do this to no avail, IFTEXT, IFNUMBER, ISTEXT, ISNONTEXT etc etc.
View 7 Replies
View Related
May 8, 2014
I have got one column in which each cell has the complete data for the entire row.
I would like to split the data in one cell into the same row.
Got about 4000 records like it.
View 1 Replies
View Related
Feb 14, 2014
A have a CSV file which contains a string of data that has a repeating pattern e.g
1234561234560N12343159753 00Company 123 Mr Smith 9874561236540N12343159753 00Company 432 Mr Jones 654987159753680N12343159753 00Company 431 Mrs A Bruce
The first long string of numbers are bank details (Sort Code, Account Number) followed by our company bank details then company name, then a reference number then the name of the account holder.
There are over 20000 records all in one long string of text and all contained within cell A1. There are also a few occasions when there is no space between the name of the account holder and the start of the next persons bank details.
What I need is for there to be a split after each account holder's name and for each persons details to be on a new row e.g
1234561234560N12343159753 00Company 123 Mr Smith
9874561236540N12343159753 00Company 432 Mr Jones
6549871597530N12343159753 00Company 431 Mrs A Bruce
Ideally I would also like the first string of information to be split in to columns so that it reads as so -
123456 123456 0N12343 159753 00Company 123 Mr Smith
987456 123654 0N12343 159753 00Company 432 Mr Jones
654987 159753 0N12343 159753 00Company 431 Mrs A Bruce
The first collumn would contain the first 6 digits, the 2nd would always contain the next 8 etc. I have tried using the Text to Columns function but it gives me seperate columns for initals etc when I would like the full name and title in one column.
View 5 Replies
View Related