Extracting Data From File Names

Oct 4, 2013

We use a bunch of equipment at work that spits out a pdf file that is going to consist the results of a particular test.

Those files are named in a unique format. It looks a bit like this:-

EH_CM42_EB0C8105G00_CPS41D_F30C3105E00_2013_09_10_08_39_25.pdf

Out of this file name it consist of the serial number (F30C3105E00) of the equipment which is the first set off italics/bold and time(08_39) and date (2013_09_10) this test was performed.

So My question is there a way or a vbs macro or anything that will be extract these three different information and save them in three different cells on the spreadsheet. BTW Also I should mention that these files are going to be stored on a network drive

PS- The only way I have figured out to do this is to create a .bat file that runs the dir command and saves it to a text file.

View 5 Replies


ADVERTISEMENT

Extracting File Names Into A Master Worksheet

May 18, 2006

As above, how do i retrieve excel file names in a specific folder and place the names into a specific column?

Say there are 2 files named UAT1.xls and UAT2.xls and i have a master file to put all this data in.

View 5 Replies View Related

Extracting Data From File In Directory And Extracting Filename

Mar 20, 2014

I have a directory folder with an active workbook and another workbook id like to copy data from. The Following macro opens up a file in the same directory, copies some data and pastes it in the active workbook. However with this code I have to specify the filename, 'Data.xlsm' in the example code. I would like it to copy data from the only other workbook in the current directory WITHOUT having to specify the name in the code, so just opening it up no matter what filename it has.

In addition I would like to extract the filename from the workbook im copying data from and paste it into the activewoorkbook in sheet 1 Cell A1. I had a look at getopenfilename function but cant seem to make it work for my purpose.

View 4 Replies View Related

Extracting Data From Inventory Report With Unknown Names

Apr 24, 2009

I would appreciate some pointers on how to write a function(s) or macro to do the following in Office 2003:

- I get a weekly report (from Quickbooks) in Excel format which shows inventory usage.

Showing the relevant sections:

Col D Name
Col O Qty
Col Q PxQ

The report also throws out Total is Col D, but only for Col Q, not Col O (which is needed)

So, R5 thru 7 may show Apples
And R 11 shows Total Apples

Then R13-14 may show Oranges
And R15 shows Total Oranges.

The report has about 400 lines currently, and about 50 items......

View 8 Replies View Related

Extracting Data From Different File Using VBA

Jan 28, 2010

i have file A3R-(345).xls, B1Z-(235).xls etc files inside folder called MyFolder.

another master file Master.xls which will extract data from files inside folder MyFolder.

what i need is to put values from file names inside Master.xls. It will loop through all files inside that folder and extract the numbers between ().
So column A in Master file will have:
345
235
..

How to do this using VBA? (only Master File should have the VBA code)

View 9 Replies View Related

Extracting Data From A Txt File

Jul 31, 2006

I have a txt file which contains a large amount of data. I need to write some code to extract the data and convert it into a number of columns...

So, the txt file contains around 200 x the following: ...

View 4 Replies View Related

Extract Data And File Names From File In Folder And Paste Into One Sheet?

Jan 13, 2013

The code below looks at file names in column A and then goes to a folder and opens and copies the data in range c2 -lastrow from each file and pastes the data into sheet2.

how I could add to the code so that it also inserts the file name in column c?

It would make it easier to track the data in column B.

VB:
Sub CopyFromFile()
Dim fPath As String
Dim lRow As Long

[Code].....

I have attached a sample workbook. The list of file name is in sheet 1. An example of the output is in sheet 2. The data in column A is dummy data generally spans 100's of rows not just 10 as in the example.

The purpose of the code is to be able to put a list of file names in column a in sheet 1 and extract data from those files in a folder. The data extraction works fine. The reson for adding the file names is so that I know what file the data came from.

View 1 Replies View Related

File Names :: File Renaming Each With The Names I Have On Another List

Jun 13, 2008

I have a task I would like some assistance with…

I have a work book that I have to copy over 70 times for over 70 work locations. As you can see, this will require different file names for each location.

I would like some have help with a code that I can use. If possialbe I like a code that will make copies of the file renaming each with the names I have on another list. Is this feasible?

View 9 Replies View Related

Extracting Month Names

Feb 18, 2008

I need to extract the month name from a cell. E.g In one cell I have a time stamp, which comes up in this formart.

Cell A1 is "5/30/2007 10:03:37 AM". Basically i want cell B2 to say "May". Please note this format is using the american date format where the order is month/date/year.

Is there a way to do this? Remember one cannot look at just the first digit as what happens for months 10 & above? At the moment I do this manually.

View 9 Replies View Related

How To Import All Data In Files In A Directory - File Names Change Each Day

Oct 9, 2008

I have a directory where our customer service people deposit forms each day. The form is always the same, with a number of columns that need to be copied into a master list. From there they are analyzed, sorted, etc, then exported, so the number of rows in that list varies from day to day as well. Is there some way to have VBA import each file sequentially from a directory if I do not have the exact file names?

I am using this import code from a macro to start with:

Sub importdata()
' importdata Macro
Range("A2").Select
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=Excel Files;DBQ=C:Documents and SettingsMy DocumentsTender Document(1).xls;DefaultDir=C:Documents a" _

[Code]....

View 9 Replies View Related

To Import All Data Files In A Directory. File Names Change Each Day

Oct 9, 2008

I have a directory where our customer service people deposit forms each day. The form is always the same, with a number of columns that need to be copied into a master list. From there they are analyzed, sorted, etc, then exported, so the number of rows in that list varies from day to day as well. Is there some way to have VBA import each file sequentially from a directory if I do not have the exact file names?

I am using this import code from a macro to start with: .....

View 9 Replies View Related

Table Names Revert To Cell Names When File Is Reopened

Jan 4, 2013

I have a worksheet with many tables that I use in formulas.

I like tables for a couple reasons, one being the ability to insert/delete rows without affecting the rest of that worksheet row.

Also, automatic copy of formulas/formatting is great.

But, what I really like about tables is the ability to use the naming conventions in formulas.

Problem is when I save this worksheet, after I close it and open it back up, all table references in my formulas have been converted to cell references.

Example:

Code:

=IF((SUMIF('Quote 1'!$M$28:$M$43,">"&'Quote 1'!$J$57:$J$60)*'Quote 1'!$G$57:$G$60)+(COUNTIF('Quote 1'!$M$28:$M$43,""&'Quote 1'!$J$57:$J$60)*'Quote 1'!$G$57:$G$60)+(COUNTIF('Quote 1'!$M$28:$M$43,""&tblOSSRV[Min Order Cost])*tblOSSRV[Cost / Part])+(COUNTIF(tblFam[[#Data],[Qty by Factor2]],""&tblOSSRV[Min Parts Per Line])*tblOSSRV[Cost / Part])+(COUNTIF(tblFam[[#Data],[Qty by Factor2]],"

View 4 Replies View Related

Create Array Of File Names/sheet Names

May 1, 2008

Two part question:

1) I'm relatively new to arrays, but what I need to do is generate a list of file names and the sheets within each one. I would like to use an array for this, but since I don't have much experience.... well....that's why I'm here. Can someone point me in the right direction?

2) And the second part of this.... I was planning on using the FileSystemObject to determine the files in a selected folder and loop through that list of files, opening each one and harvesting the required info (file name and all sheet names). Should I use the FSO or is there something built into Excel that might be better (and also limit the number of dependencies for this little "project" of mine).

View 9 Replies View Related

Extracting Names From A Column To Another Sheet Based On Criteria

Jul 6, 2014

I have a column containing names, blank spaces, numbers, a bunch of miscellaneous things. However all I want to do is extract only names, into another sheet, and not the numbers, blank spaces, etc. Youi'll see what I mean when you open the attachment. Offset isn't an option because the names don't appear in the column in an organized fashion.

Dummy workbook.xlsx

View 3 Replies View Related

Folder Names Instead Of File Names/macro

Dec 10, 2008

I need to make this macro read FOLDER names instead of FILE names. When I posted this question yesterday to get this macro, I wasn't told that each file in its own folder. I need the folder names now.
_____________________________________

Sub test()
With Application.FileSearch
.NewSearch
.LookIn = "C:Ford"
.SearchSubFolders = False
.Filename = "*.*"
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Cells(i, 1) = .FoundFiles(i)
Next i
Else
Cells(i, 1) = "No files Found"
End If
End With
End Sub

View 9 Replies View Related

Opening Excel File From List Of File Names Located In Single Sheet?

May 31, 2013

loop and range function to apply in the below code through which I can avoid writing code for all the rows.

I am trying to open excel files located in single folder from files name (along with the path) in single worksheet (Column B and Row 1 to 500).

I have created follwing code which opens the file and then runs a macro in it.

a Sub Test()
Dim strFName As String
strFName = Sheet1.Range("B2").Value

[Code].....

View 4 Replies View Related

Extracting The Extension Of A File

Dec 7, 2009

I have a list of file names in an excel sheet. The requirement is to find the extension of each file in the next column. For example
file name 123.456.789.jpg
extension jpg

file name 123.abcd.789.xlam
extension xlam

is there a worksheet function equal to InStrRev in vba?

View 6 Replies View Related

Extracting File Information

Jun 5, 2008

I have a macro that lists all documents in a selected folder and am looking to add the author/owner, created on date, last saved date as shown in the document properties.

The code I'm using is: ....

View 9 Replies View Related

Extracting Value From External File

Jan 29, 2004

I have been trying something like this before, i could not get it fixed. Let's give it another go:

I have a number of files in a specific folder. I need to extract values from cell Sheet1!G42 out of [b]every file[b] in this folder. Problem that occurs, is that I do not know how many files are in this folder, neighter do I know what the filenames are. I need some magic to perform extraction of the desired values.

As for the files in the specified folder I have this VBA code, that suits my needs just fine:

Private Sub Workbook_Open()
Dim fileList() As String
Dim fName As String
Dim fPath As String
Dim I As Integer

This code will display all found files, including their path in column AD. (as plain text)
[b]Question that remains:[b] how am I to fix a formula In (column AE) that will extract the value found in Sheet1!G42 of each file? This must be very easy, but i can’t get this to work….

View 9 Replies View Related

Copy File Names From A Directory Into An File

Mar 11, 2007

Is it possible w/ some vba code to copy the names of files, either from a search or a specific directory to an Excel Worksheet?

View 9 Replies View Related

Extracting Month And Year From File?

Sep 12, 2013

I have the Month and Year in the name of the workbook for eg Sales July 2013.xlsm

I would like a macro to extraxt the month and year from the file name and put this in shewet2 in cell E1

View 4 Replies View Related

Extracting Text Fields From A Txt File

Jan 24, 2010

I have a file from PubMed with a bunch of citations in it, which often go above 10,000. There are fields that mean certain things and I would like to be able to import the text file into Excel and parse certain fields into columns.

The text file looks like this:

PMID- 19782657
OWN - NLM
STAT- In-Process
DA - 20091109
IS - 1872-6240 (Electronic)
VI - 1303 .......

View 9 Replies View Related

Extracting Sub-folder From File String

Apr 13, 2007

I've got a host of files within a host of directories, e.g:

c:ContractsJim BobJim Bob Site.xls
c:ContractsJane JonesJane Jones Place.xls
c:ContractsJeremy HillsHills House Lvl 1.xls

I'm working in VBA to try to extract the site name from the file string. Unfortunately there is no other reliable location where I can find an accurate name of the site, so it needs to be taken from the second subdirectory. So I'm using the following code to get the file location:

Sub FilePicker(fileToOpen As String)
ChDrive "C:"
ChDir "C:Contracts"
fileToOpen = Application. GetOpenFilename(FileFilter:="PPM Files (*.xls),_
*.xls", Title:="Select a PPM Scope File", MultiSelect:=False)
End Sub

This returns a string along the lines of "c:ContractsJeremy HillsHills House Lvl 1.xls". From this string, I need to isolate the string "Jeremy Hills".

View 3 Replies View Related

Can Create Data Validation List Of Names Created In Name Box Or Sheet Tab Names

May 7, 2012

Can I create data validation list of the names created in the name box or of the sheet tab names?

View 5 Replies View Related

Adding Date Modified To PDF File Extracting Macro

Jul 3, 2014

Below Macro which I am using to extract .PDF files. Now, I also want to see the Date moified while extracting the .PDF files. Hence, adding date modified to this macro.

Sub get_pdf_name()
Dim FR As Long, sh As String, FPath As String, FName As String
sh = Sheets("Sheet2").Name
FR = Sheets(sh).Range("A" & Rows.Count).End(xlUp).Row + 1

[Code] .....

View 1 Replies View Related

Extracting / Importing Tables From Several Word Files To Excel File

Jul 17, 2013

I have several word Files which has standard letter format and contains some tables which needs to be extracted / imported to Excel sheet

The File name is "employee name" which also needs to be extracted , if possible in same excel file.

Attached is the sample of word file. There are 3 tables which needs to be extracted

I have several files and I want to avoid doing it manually.

View 2 Replies View Related

Export File Names To Excel?

Nov 15, 2010

i would like to export the sub-directory file names to excel.

View 5 Replies View Related

Macro For Retrieving File Names

Jan 10, 2008

Here is what i have:

View 13 Replies View Related

List File Names From Folder

Apr 30, 2009

Need code to open a browser to select a folder and list the files in that folder in excel. I do not want to include sub directories.

View 4 Replies View Related

Query File Names In Folder

May 28, 2009

Is there a way to write somethign that will go to a particular folder on your computer and bring back the Names of all files in that folder?

I need to build a sheet that lists certain information from each file, which is already included in the file name - trying to avoid opening hundreds of files just to get data from one cell....for example:

All files are in the following folder: ....

View 11 Replies View Related







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