Defining Field Format For Data Import From CSV

Jul 23, 2008

on data import from CSV file. The file is formated in a sligthly strange way:

"London","182.56","12/12/2007"
"Paris","133.41","27/12/2007"

I get into problem when importing using default CSV settings as numbers and date are understood like text. I need to replace "." with "," to get to number format. Used following
Range("J5:K9999").Replace What:=".", Replacement:=",", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

However I get values multiplied by 100 for some reason.

Converting date format gets eeven more complicated.
So I decided I can not use standard CSV import and need to define separate data source for each raw file This is not what I wanted, since I do import many files (10 at this point in time, but it will get growing). However, I would be ready to do that if there is no other option. So I go to "Create New Data Source" and under "Connect" I get to another input box called "ODBC Text Setup" where I select "Options" to define customer format. However, after selecting source file, Excel is not able to interprate fields. Tried clicking "Guess" button, no luck there. Thought it is because fo those "" before and after field value. So, just for a sake of experiment I opened file in text editor and removed those ". Still, can not read the file. The error message says "Text file specification field separator matches decimal separator or text delimiter. Guess failed"

I am out of ideas how to get this file properly imported. Hope there is a way to do that either by defining field formats while importing (perhaps that can be done via SQL, but I am not confident with it) or writing some code to change format after importing from text to Number and Date...

View 9 Replies


ADVERTISEMENT

SQL Syntax - Defining The Format Of A Field

Apr 4, 2006

I use ADOBD.Connexion / Microsoft Jet SQL to connect to Excel tables and create a pivot cache.

I need to understand the required SQL syntax to define a field format.

Exemple:

SELECT Table1.Field1 FROM Table1

And I need Table1.Field1 to be treated as text

How can I set the format of a field in my SQL statement?

View 9 Replies View Related

Specify Format Of Access Data Import

Oct 3, 2006

I tried to upload my spreadsheet but the zipped excel spreadsheet was 78KB over the forum max. Its hard for me to explan this without you looking at the spreadsheet. Basicly I'm exporting data from Access to Excel into a spreadsheet. When the data exports into excel I want the data to be formated in such a way and this is where some code will need to be written. I've made up 2 spreadsheets within excel. One sheet is how the data comes into excel from access and the other sheet is how I'd like the data to look without me having to doctor the sheet every time I export.

View 9 Replies View Related

Date Format- Data Retrieved Via Import Data Tools

Feb 4, 2009

I have the following data retrieved via import data tools ...

View 9 Replies View Related

Search And Import As Field

Feb 11, 2007

I have a log file with this format;

MML Command;
Field1 Field2 ...
Command Executed;
DIfferent MML command different fields. I need to search first the MML command, then search again the Field1 Field2 as I need. Since the format of field between MML command is different each other's, I cannot import it to excel. So How can, I start to do the vba, to search a MML command i need, and then field1 etc.. and stop at command executed,??

View 2 Replies View Related

Import CSV With Commas In Description Field?

Dec 2, 2013

One of the fields I am importing has got a description with commas in. When I import the description is wrongly split. How can I fix that? KS14411011,22490030,"Airconditioner,Wall",5512

Code:
Private Sub cmdImportFile_Click()
Dim ImpRng As Range
Dim Filename As String

[Code].....

View 2 Replies View Related

Convert A Text Field To Numeric On Import

Feb 14, 2007

I have a fields coming in that are text but should be numeric. is there a formula I can put in the cell to convert it from text to numeric?

The original database has the numeric fields stored as text, but I need to import them into Excel and do calculations on them.

View 6 Replies View Related

Getting Zero Formula Field When Data Field Blank / Empty

Feb 13, 2013

I have a simple formula ='info page'!b2&'info page'!b5 in places that on my sheet adds a company prefix to a item number, prefix in b2 and item in b5, we have a client that we cant use prefixes but now when I leave the field blank its giving a zero and thats not good either. I'm pretty sure an IFERROR or something will work but can get the syntax right.

View 5 Replies View Related

Counting Per Date Field And Data Field

Apr 29, 2006

I am trying to count the number of times that data is in a field and in any field the date is greaert than today's date. This date field could be blank and that is where I am having the problem.

Example

See Attached

View 4 Replies View Related

Defining Variable Data Row For Chart Series

Oct 5, 2006

I want the below code to run from R1C10 (i.e. cell J1) to the end of the data in the row, which will vary in position, rather than having to define where the end of the row will be beforehand (i.e. R1C21).

Is this possible?

View 9 Replies View Related

Automatic Time Format In Form Field?

Mar 10, 2009

How can I have a form field automatically fill some aspects of the data that's input? I've seen it before, like a phone# field automatically including the dashes.

I would like to automatically include colons in a time field. So if I were to type "081500" (or even "81500"), it would complete it as "08:15:00".

View 11 Replies View Related

Converting A Text Format Field From M10235 To M000010235

Jul 10, 2014

I am using excel to compare data from one spreadsheet to another. However my utility is not capturing identical matches since one worksheet eliminated the leading 0s while the next worksheet includes all 0s. Our system should actually have the 0s to identify the data correctly.

Worksheet 1
M10235
Worksheet 2
M000010235

I would like to convert Worksheet 1 to show M10235 in the format M000010235 so that the number contains the prefix M followed by nine digits.

View 2 Replies View Related

Date Format Error - General Number Field

Feb 18, 2013

I have a spreadsheet with a column full of dates

I used the formatting wizard to make all dates the format of dd/mm/yyyy but, now, when I put a date in the column it throws up a number '41313' instead of a date, even if I manually input the date in the same format as above.

Also, I have tried to turn cells back into general number fields, but this doesn't appear to be changing it back to a date format..

There are HUNDREDS of dates I might have lost if I can't get them to start showing as dates again!

View 2 Replies View Related

Import, Format, Convert, Print VBA Module

Apr 14, 2009

I was wondering if its possible to build a module that would do the following: a) import a txt file to excel formatting it as text.

b) then in column D would remove the preceding space.

c) then convert data in D according to a separately kept Conversion table (or conversion table could be integrated into the code) and print conversion results into column J.

d) the last step is to print/copy columns A and J so that it looks like the final table in Sheet2.
Here are files attached.

sample data.txt
sample data.xls
conversion table.xls

To summarize I need to go from a txt file like the one attached and arrive at the table in Sheet2 of xls file attached.

View 8 Replies View Related

Import CSV From Web As UTF8 And Format Column As Text

Aug 7, 2012

I have a piece of code that imports data from a database on the web. It works but the import uses the wrong encoding. Excel also messes up a column with id-numbers, starting with three zeros that are removed by Excel.

How can a change my code so that it imports the data as utf8 and the columns as text?

Code:
Sub csvAll_diva_update()
Dim url As String
url = "URL;http://kth.diva-portal.org/dice/csvAll?query=-publicationTypeCode:studentThesis&start=0&rows=20&sort=author_sort%20asc"

Sheets("DiVA_All").Activate
ActiveSheet.Cells.Clear

[Code] .......

View 1 Replies View Related

Import Web Query Looses Number Format

Aug 29, 2006

I am wanting to use Excel to perform a web query into an online database our company uses. One of the columns I am wanting to import contains numbers that are 20 digits long & they begin with 4 zero's. The problem is that when Excel imports the query, if I fprmat the cells & preserve the formatting, it cuts off the first 4 zero's & replaces the last number with a zero. Basically, it looks as if it is only importing 15 numbers. Is there a way around this ; is there a way to force Excel to import all 20 numbers? If I don't format the cells, it imports in the following format - 4.20017E+15

View 4 Replies View Related

User Form Field Inserts Wrong Date Format

Mar 26, 2009

I have cobbled together (borrowing from examples I have found online because I don't know VBA) a form which inserts a date into a spreadsheet.

The trouble I have is that this date field is in USA date format and I need UK.

If I enter 03/01/2009 into the form, it appears in the spreadsheet as 01/03/2009. I have formatted these cells to display the month only and because of the way it was entered, the next column displays MAR instead of JAN.

Can I validate the input value in a form?

View 7 Replies View Related

Format Text File For Excel To Import Into Access

Jan 12, 2010

I have a large text file that is generated daily and want to import into MS Access as the end result.

First I need to reformat into the row format in excel rather than the format it is in. The issue is not all the segments are the same number of lines or they may have mutli message lines. The names with colon : after them I want to be field names in the table which I wish the text file to import into. Please, I am looking for assistance with this.

I have attached sample data of the text dump, and the name of the file is as you see but different date on the end. At the very end of the text file you will see the desired output which I will then import into Access

Also every new message begins with the dotted line and the date and time at the end.

View 14 Replies View Related

Auto Populate Field With Date When Other Field Is Selected From Validation List

Jul 4, 2013

In the following extract, I would like to have today's date placed into Col K when an entry is made into Col J.

Entry into Col J is from a validation list of 3 options. What I desire is that when one of these options is selected ("Complete"), then I would like today's date to be written into Col K.

Currently Col K has a validation list which comprises dates from 1st of each month from July to June.

I need a fixed date as text preferably, so was thinking the VBA function "Date" on a Change Workbook Sub.

The information is currently part of a Table in Excel 2007 that has about 500 records.

IdeasList

*
J
K

2
Status
Month Completed

3
In Progress
*

4
Complete
Jul-13

5
*
*

6
*
*

Data Validation in Spreadsheet

Cell
Allow
Datas
Input 1
Input 2

J4
List
*
=ValidationList_Status
*

K4
List
*
=ValidationList_Months
*

View 2 Replies View Related

Macro To Preset Field With Text If Condition In Another Field Is True

Jun 9, 2006

I have a macro that imports a report. If the Charge Type in column A is BTOREPLX, I need to prefill the field next to it in column B with the text "REPLX", e.g. "REPLXCDROM". I've attached an example of the report.

View 5 Replies View Related

Change/Move Pivot Table Row Field To Column Field

Apr 23, 2008

In building my pivot table my data that I want to show in the column area is showing up as rows stacked on top of each other. In the column section I'm trying to show Total Budgeted Amount next to Total Actual Amount but on the layout it's showing the two stacked on top of each other is there some kind of hidden key that I'm missing?

View 3 Replies View Related

Excel 2007 :: Import Data From Worksheet Into Another And Group Data Into Sections

Mar 2, 2012

I want to be able to run a macro that will export some of the data from a worksheet called Generated Report into another worksheet called Matrix. The data will be taken Generated REport and grouped into sections of the worksheet. These sections will be defined by the BRID value.

The Data that i want to export will be from the first 5 columns within the Generated Report(note there are other columns which data is not required from).

The following columns will be exported from Generated Report -

BRID,Requirement, Bug Description, Bug ID and Alt Bug ID.

BRIDRequirement Bug DescriptionBUG ID Alt Bug ID
PQ115 PQ115-Login Bug Description text xihllloloj43712 123
PQ116PQ116-Landing Bug Description text ghghghgoot 43713 126

For Matrix

The data will be imported into Matrix worksheet into the following columns as part of the row headings

- Requirement, Description, Bug ID and VF Bug ID.There will also be other columns (outlined below) which i will use to manually enter data

The data will be grouped and imported into the relevant section by its BRID eg PQ115, PQ116 etc.

I want each section (marked by BRID number)to be separated by row headings.

These row headings are to be generated after populating all data within each BRID number.

When the data has been populated in each row there is a column called 'Status' which contains drop down list boxes which can be assigned.

The default status will be set to 'To Do'. The complete row headings are displayed with Output from Generated Report underneath

BRID Priority Requirment Description BugID Alt Bug ID PC UpdateNotes Actual Result Type of DEfect Test Status Tested by
PQ115 PQ115-Login Bug Description text xihllloloj43712 123 To Do

BRID Priority Requirment Description BugID Alt Bug ID QC UpdateNotes Actual Result Type of DEfect Test Status Tested by
PQ116 PQ116-Landing Bug Description text ghghghgoot43713 126 To Do

So far the macro that i have been using allows me to locate the data for each specific BRID in Generated Report and copy into the corresponding BRID section within the Matrix. I have to repeat this step for each new BRID and i want to be able to whole automate this process.

View 5 Replies View Related

Import Few Data From Table To Another Sheet By Date Data?

Jan 22, 2014

i attach the file so you can look after you read

i have soccer table 1 sheet is "teams" which is the table of the league. 1 sheet is "games" which is the table of games of the league the last sheet called "import by date". in the end of every game day i sent email with the results of current day. for now im copy and pate all results and its not that easy and convenient. i want to make some formula that when i click in import data sheet the date its shows me all the results from that date. i try to do it with pivot table but didnt like how it displayd

View 2 Replies View Related

Import Website Data Into Excel (Scrapping Of Data)

Jun 20, 2014

I have a tedious task of copy/paste from our website. have a look at below sample data. I have around 1500 rows of data like this.

Sheet1
A
B

[Code]....

Column A has input data which i need to copy and paste in a web form. Column B will have results scrapped form webpage[ URL]. This webpage will need login details

If a code can be written which take value form column A of spreadsheet and paste in webpage like shown in above image and hit search button. Next webpage will be loaded with number of results like shown in below. Take the number of results and paste in column B of spreadsheet.

View 1 Replies View Related

Auto Populate A Field In One Tab By Comparing Another Field In A Different Tab?

Jan 25, 2013

I have a tab called 'Tab1' in which I have column called 'Col1' and 'Col2'.

I have another tab called 'Tab 2' with columns 'ColA' and 'ColB'. When I enter a text in Col1(Tab1) I would like that text to be compared to data in 'ColA' from Tab 2 and when match found then get the corresponding value from ColB and autopopulate it in Col2 of Tab1.

View 2 Replies View Related

Changing A Numerical Field To A Date Field

Dec 28, 2006

in coverting these fields into a date field.

Example 91306 to 060913

I have encloed the file.

View 14 Replies View Related

Import Multiple Text Files & Copy Each Import

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

Format Climatic Data From A Weather Station Into A Desired Format

Feb 11, 2009

I need to format some climatic data from a weather station into a desired format. There are a lot of cut&paste and transposing involved. I think it will be easy but tedious for anyone trained in VB to write a macro but unfortunately I am not. I've tried recording a macro but it turns out that it is not general enough to deal with all the spreadsheets that I've got.

I've attached a spreadsheet which shows the original format (in sheet 1) and the desired format (in sheet 2). To briefly describe, I only need the temperature data for 8am and 2pm, the rest of the information in sheet 1 is useless to me.

View 2 Replies View Related

Convert Data In Invalid Format Into Correct Format

May 1, 2014

I have around 30k data. which is in invalid format.

Ex: 12987654321vinay kk 876543219
32567456789 kkccjhg fo 345678921

I want to convert this into correct format as below with start letter from

MOD, 987654321,, vinay, kk,87654219
MOD,567456789, , kkccjhg, fo,345678921

I want to know which are formulas I have to use to get this info in correct format.

View 1 Replies View Related

VB Macro To Add Field Within Data

Jan 26, 2014

Refer to attached sheet.

There is data in column A.

Need VB Macro to extent the data upto A30500.

The data for each row needs to be the same as data in cell A1 except the part A30000,A30001 etc.

This number needs to changed A30xxx where xxx will be 002,003,004,005 and so on until 500.

Test.xls‎

View 3 Replies View Related







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