Dates After Text Import
Aug 12, 2008
I have imported data from textfile reports generated from a dBase system with the following
Sub ImportData()
.........
End Sub
The problem I have now is that during the operations on the date collumns (G-K) Excel has converted the date to dd/mm/yyyy format, just as I wanted - but has for instance sometimes interpreted the date 10/06/2005 (10 Jun 2005) correctly and sometimes as 06/10/2005 - with no consistent logic I can discern.
I can't get hold again of the source data (the reports) and would need to somehow correct the dates.
The data is historical booking information of a Tour-operator. Therefore there are some hints that would allow me to check if a date makes sense or not. In each row is a start-and an end date in collumns D & E, which would need to be checked for correctness. The following may giv you an idea what I am babbling about: .....
View 9 Replies
ADVERTISEMENT
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
Aug 13, 2008
I am exporting data to Excel from a 3rd party application - the bulk of which are date entries. For some reason they do not come across as date fields in the cells, and you need to double-click on each cell to correct it. For instance if I try to filter the dates straight after the export to Excel, the cell entries are not recognised.
Anyway, I managed to get around this by running a macro on each column, e.g. for column C:
Columns("C:C").Select
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, FieldInfo _
:= Array(1, 4), TrailingMinusNumbers:=True
This only works however if there is at least one entry in each column. Is there a way of telling Excel to skip that column if it is empty
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
Apr 9, 2013
Some of my numbers turn into dates when I try to import them. Is there anyway around this problem?
I have 500k+ rows with data, so looking through each and every cell is not an option.
View 2 Replies
View Related
Oct 21, 2011
I am in strange situation where I have a data with Invoice Dates. These dates are in Text. However, when I convert it into reall excel dates. For some reason the dates do not come right. convert my text dates into excel real dates. I did a lot of google search and apply these three methods but all of these gave me strange result I was not expecting. These are the methods I used and the result of each method.
Method 1 : Using Text to Column Wizard (Excel 2007)
I highlighted invoice column and went into text to column wizard. I clikced on Date button, and selected MDY format. Strangely enough, my result was day, month and year i.e. DMY which does not seem right.
Then I press Control ~ on this data as shown in second view.
Inv DateMDY09/22/1122/09/201108/31/1131/08/201108/31/1131/08/201108/31/1131/08/201108/31/1131/08/2011
control ~ (overview)
Inv DateMDY09/22/114080808/31/114078608/31/114078608/31/114078608/31/1140786
2nd Method - Using formula to convert text date to real dates When I used formula, I get the following result. As you can see, formula is converting text dates into different system dates than the first method.Further strange things is when I take these system dates i.e. 4283 and in 2007 excel format use "Short Date" the same system date gets converted into wrong year as shown in the second view.
Inv DateFormulaFormula Result09/22/11=DATE(MID(B2,7,2),MID(B2,1,2),MID(B2,4,2))428308/31/11=DATE(MID(B3,7,2),MID(B3,1,2),MID(B3,4,2))426108/31/11=DATE(MID(B4,7,2),MID(B4,1,2),MID(B4,4,2))426108/31/11=DATE(MID(B5,7,2),MID(B5,1,2),MID(B5,4,2))426108/31/11=DATE(MID(B6,7,2),MID(B6,1,2),MID(B6,4,2))426108/31/11=DATE(MID(B7,7,2),MID(B7,1,2),MID(B7,4,2))4261
2nd view - system dates are getting converted into 1911
Inv DateFormulaFormula Result09/22/11428322/09/191108/31/11426131/08/191108/31/11426131/08/191108/31/11426131/08/191108/31/11426131/08/191108/31/11426131/08/1911
Similarly, I tried other methods or copying blanks etch but none seems to convert text dates into real (system dates).
View 4 Replies
View Related
Nov 14, 2013
I would typically consider myself a decent Excel user, but I haven't been able to solve this one. Maybe it's just the lack of sleep now. I am attempting to combine 4 cells into one where the last cell contains a date. Below is the formula I am using:
=B3&" "&C3&" "&D3&" "&TEXT(E3,"m/d/yy")
It works when all of the cells have values, but the only problem I am having is that some of the dates (in column E) are blank. When this cell is blank the default date that displays is "1/0/00." If I add the typical, " " at the end it says the formula has errors. The need for the TEXT(E3,"m/d/yy") for the cells that contain dates is throwing me off.
View 3 Replies
View Related
May 18, 2007
I have a very large spreadsheet that comes out of SAP and it brings out the majority of cell entries as text ie putting a ' at the begining of any number. the problem that i have is with the cells that have a date in them ie '19/04/07. I have tried varioous methods to remove this and turn the cells into date format but to no avail.
Also i do not get the option to convert text to number
View 6 Replies
View Related
Feb 13, 2008
I have a WAY to complicated excel form that I'm going to move to Access but I need to have this working in the interim. The form has a dynamic element, the user can choose the number of items they are ordering and it unhides the required number of text boxes. To keep the scripting down a did a little work-around to update the database using a loop through the form controls:
'Save the main row
MainOrderRow = ActiveCell.Row
LastRow = MainOrderRow + (ExtraOrders - 1) ' Calculate the last row
ExtraOrderNo = 1
For DBRow = MainOrderRow To LastRow
' Save the text box name with the extra order number
k = "txtDescriptionMul" & ExtraOrderNo & ""
l = "txtQuantityMul" & ExtraOrderNo & ""
m = "txtTotalValueMul" & ExtraOrderNo & ""
n = "ComboBoxUnitMul" & ExtraOrderNo & ""...................
View 2 Replies
View Related
Aug 9, 2008
I have a macro that searches and replaces dates (both text and date formats) in all files in a folder. It works if I initiate it from the VBA Editor, but not if I initiate it from the file.
It seems that the worksheet is not activating. Please take a look and let me know what I can try.
Things I have already tried: Window methods, such as minimizing the workbook that contains the macro, activate next, etc. Also putting the macro in Personal.xls and retrieving the values from the other file.
Where it hangs is right after the first workbook in the folder is opened. I tried to get it to select A1 in the active sheet but that cell is not selected in either the macro workbook or the newly opened workbook.
Also, if there is an easy way to exclude my macro file (name contains ZZZZ) from the FileSearch............
View 9 Replies
View Related
Aug 22, 2008
The task given was to import selected info from complicated text file and record into excel.
Here is the simple way of showing the txt format (consist of 2 records for example):
=================================================
Proxy Id 123
MO ABC
=================================================
GID_Group TAX8200
Account 0 (INTRA)
loadSharingCandidate 0 (FALSE)
RelationType 0 (TRUE)
Offset 0
Priority 2
=================================================
Proxy Id 123
MO ABC
=================================================
GID TAY8200
Account 0 (INTRA)
loadSharingCandidate 0 (FALSE)
RelationType 0 (TRUE)
Offset 0
Priority 2
How can i have the output as per attachement? I am not good in importing text files. Shouldi use something call ADO? or what is the most easiest way for me to start?
View 11 Replies
View Related
Apr 11, 2014
I was able to import some text from a PDF to excel. My dilemma is that the text is now one long row with CODE in column A then its description in Column B...the next entry has a Code in column C with its description in column D...etc...down the line.
I need Column 1 to be all the codes with description in column B thus allowing Vlookups.
Here is sample:
A B C D E F G H I J
AC
Araucanian
AD
Adangme
AE
Afroasiatic
AF
Afrikaans
AH
Amharic
Any text column type deal?
View 3 Replies
View Related
May 27, 2006
I have about 120 .txt files with Columns A Code of Users[/b], Columns B Number of Conto and Columns C-K with stings to be imported, like Numbers into one .xls file .
(see part of examples down and Attachment Red marked)
ABCDEFGHJK.........
Files have names V1.xls, v2.xls ...V120.xls. It have been requested to imported only certain rows e.g. Rows:
02178;5171;untill 02178;5175; Columns C-K, including Columns A i B
&Rows only 02178;5179; same Columns C-K, including Columns A i B
Each Cells from C-K should be importing to same Sheets .xls files. Note: String to be converting to Number After importing datas from one files should have take new datas from anothe files, same rows and columns, one under another and Calculating Sums.
View 4 Replies
View Related
Jul 18, 2013
I use text to columns everyday at work. Each report that I insert is in the exact same formatting and spacing. So, I open the text file, and manually enter line breaks each time. Is there a way to import text into an already broken up table? Or a way to open a file and it recognizes where to break up the lines without me having to manually click them in each time?
View 4 Replies
View Related
Mar 11, 2014
I have a lot of txt. files you would like to imported automatically via VBA code text file is always the same need only certain data in these two rows which is the red just want this data
it is copied from txt. files in Excel so that I had with the click of a button you obtain all the information and through this button you looking for the folder in which the data next would have 2 lines one would be the computer name of one folder and the user can more This would also be the folder in which the data were computer name to the main folder subfolder, users, and wanted to let me read the particulars of which are in the name of the computer and the user. for example. computer name of the user
i have in excel what i need
View 5 Replies
View Related
Mar 27, 2009
I recorded the following macro but it only imports files with a specific name. Can someone change the code to allow it open the specific file loaction where I may choose which .txt file I want to import.
View 3 Replies
View Related
Sep 27, 2009
I've a large text file which I need to import selected information only.
Below is the sample text file which showing profile for 3 item.
View 14 Replies
View Related
Feb 17, 2007
I need to be able to open or import a csv file and have the data be seen as text, not numbers. I can export programming from a phone system as a csv file, modify it and import it back into the phone system. some fields such as "seconds" are in the format 00. Excel sees it as a number and converts it to 0, which causes an error when I try to import again.
I have tried changing the csv to txt and copying it to a blank worksheet and then recording a macro using text to columns, but each export can be laid out differently, so a fixed array doesn't work. there can be over 100 columns so doing it manually and changing each column to text can be quite tedius.
View 5 Replies
View Related
Aug 31, 2010
I have imported a tab delimited text file into excel. One of the columns consists of a string of text - a comment section. Within this column, there are periods and for some reason it seems that Excel is treating these periods as row separators. how I can prevent Excel from separating the text into rows?
View 3 Replies
View Related
Jun 18, 2014
I have about 100 text files from which I need to import specific sets of numbers into excel. The part in the file looks like this
Mg24(MR)1917.4198.5
Mg25(MR)250.453.6
Mg26(MR)264.464.2
I need to import the numbers in the 1st row but they need to be transposed. and than of cause I need to do that for the other 99 files I have.
View 14 Replies
View Related
Feb 16, 2009
I am trying to write a Macro that will alow me to choose a text file to important but bypass the Import Text Wizard when doing so. I used the record macro function to get this
View 4 Replies
View Related
Apr 21, 2009
I am a noob to VBA, and not much of a programmer either.
I know how to import a simple text file into excel, but this time I have something more complicated.
View 6 Replies
View Related
Oct 31, 2009
i want to do is import multiple text files,with fixed arrays (luckily it's standar )
I have the piece of code that i currently automatically importing these .txt files,although it's for one per turn.Here it is though,to see the arrays
View 6 Replies
View Related
Jan 14, 2010
I am trying to figure out a problem. So far without any results. As an Intern at a company, every week I receive a .txt which I have to import and reformat in Excel. Every week this means several hours of work, so I decided to see if this process could get automated. Or at least partially. I was wondering if any of you could give me a hint how to do this, or where to start. Attached you will find the raw .txt data and the format it should get in Excel.
View 3 Replies
View Related
Jun 5, 2013
The Workbooks.OpenText works for me, but I need to import the text file into one worksheet of an existing workbook. Is there a method to do this?
View 1 Replies
View Related
Aug 6, 2013
I am trying to import a range from a txt file that is not opened. It would be in cell AM2 if opened in excel, or it would be the 38th tab of the 2nd row.
I have it working by opening the file copying the cell and pasting into the destination cell. but I have this looped for each text file in a folder. this takes a very long time.
How can this be done faster? I have been trying to figure out how to use For input as ... but haven't been able to grasp how to manipulate the code.
View 3 Replies
View Related
Aug 17, 2007
Can't seem to get a VLOOKUP to work and import alpha text such as a person's name. Is there a formula that would do this similar to a VLOOKUP?
View 9 Replies
View Related
Feb 16, 2009
I need 3 columns - Title - HD - Channel. If no value for HD, the field would be blank.
Data looks like this in txt file:
> A&E HD 265
> ABC Family HD 311
> Altitude Sports and Entertainment HD 681
> American Movie Classics (AMC) 254
> Animal Planet HD 282
> BBC America 264
> BET Jazz 330
> BYU TV 374
> Big Ten Network HD 220
> Black Entertainment Television (BET) 329
> Bloomberg Television 353
> Boomerang 298
Needs to look like this in Excel
> Should look like:
> A&E HD 265
> ABC Family HD 311
> Altitude Sports and Entertainment HD 681
> American Movie Classics (AMC) 254
> Animal Planet HD 282
> BBC America 264
View 9 Replies
View Related
Aug 25, 2009
I have a large text file, 75mb, that I would like to import into Excel but it goes well beyond the 65536 lines available.
Is there a process to get these files into excel? File splitter?
View 9 Replies
View Related
May 3, 2006
I am pasting query results from WinSQL into Excel and use 'Paste' and then, from the little Paste Options icon, 'Use Text Import Wizard'. I choose tab delimited and then reset the decimal separater using the 'Advanced' button on step 3. Since I do this daily I would like to create a macro to do it all for me, namely paste what I have already copied to the clipboard using the appropriate settings. Recording doesn't reflect the steps I executed. How can I call the text import wizard from vba with the clipboard contents as input as opposed to a text file?
View 5 Replies
View Related