Search CSV Files For Word & Make .xls Files Of Them
Jan 23, 2008
I have 22 CSV files. I want to search each of those files for a specific text string (ie: "profile" or "description"). When the macro finds the word in any one of the CSV files I want it to copy that complete csv worksheet and paste it into an excel xls file.
how I can go about doing this. Not also that while vlookup is possible, its very time consuming if i have to do this 50 times over and each time the csv files have different file names. that is why i want to search within a file (each file has its own unique identifying text string)
View 2 Replies
ADVERTISEMENT
Jun 26, 2008
Is there a code that will search a pre-determined folder for all .xls files containing the word "Temp", and deleting those files?
Example:
In the root of drive M, I have several Excel files. Anytime one of the original tracking logs is opened, a temp file of that log is automatically created. I would like to automatically search the drive and delete all files containin the word "Temp".
I've attached a picture of the directory tree, in case that will help. The file will always be named "PO Response Tracking - Temp#######.xls", with ###### representing a series of either 5 or 6 numbers.
View 14 Replies
View Related
Nov 9, 2002
I need to get a word cound from 140 excel files.
I don't want to calculate cells with just numbers and they have to be words.
Better still If I could get all the text into one word document, that would be even better.
View 2 Replies
View Related
Dec 6, 2012
i have an excel file(master copyvba.xls) in which i have my vba codes. My problem is that each time i open another excel file ,my vba codes does not work. I must open my master copyvba.xls to enable macros in my other file.how to make the vba codes available to my other excel files ?
View 2 Replies
View Related
Dec 3, 2006
I would like to list all files in a directory (display the full path) and make hyperlinks to all listed files at the same time.
I came accross the code below which works well for files in a directory:
Sub HyperlinksToDirectory()
' puts hyperlinks to each of the files in a directory of your choice
' into the active sheet starting at the active cell
Dim stDir As String
Dim stFile As String
Dim R As Range
Set R = ActiveCell
stDir = InputBox("Directory?", , Default:=CurDir())
stFile = Dir(stDir & "*.*")
Do Until stFile = ""
R.Hyperlinks.Add R, stDir & "" & stFile, , , stFile
Set R = R.Offset(1)
stFile = Dir()
Loop
R.CurrentRegion.Sort key1:=R, order1:=xlAscending, header:=xlNo
End Sub
View 9 Replies
View Related
Aug 6, 2005
I've got many file (one file for one month) and number of records are nearly 65K for each month. So i must separate data for each month in one files. As the result, I;ve got so many files that i must generate report from. how can I generate privot table from many excel files with the same database structure.
View 8 Replies
View Related
Jun 2, 2014
What I want to create is an excel file such as:
A
B
C
1
File
Qty
Yes/No
[Code]......
Where Qty sets how many copies for that particular doc, and Yes/No determines if it needs to be printed at all.
Each file will be in a subfolder relative to the excel file.
So it would work like this (somehow)
If Cell, C2 = 1, then print CurrDirSection1examplefile.xlsx, qty= B2 , defaultprinter
If Cell, C3 = 1, then print CurrDirSection2examplefile.docx, qty= B3 , defaultprinter
If Cell, C4 = 1, then print CurrDirSection2examplefile.docx, qty= B4 , defaultprinter
and so forth.
View 3 Replies
View Related
Jun 18, 2013
I found some code on here the other day which will do though all the files in a folder and send them to a zip file which works great how to zip a single fixed file. I down load files from our oracle system daily and need to keep them but want to keep the file size down.
Code:
Sub ZipPackage()
Dim ZipFile, TargetFolder, NewFileName, ofile
Dim o As Object
[Code]...
But the "ofile" doesnt contain the file type. Is there away to adjust this code so it recognises what the file type is?
View 6 Replies
View Related
Sep 15, 2009
i have a txt file see attached and i need macro to:
1)open the file
2)find the word "Dimension no: 3"
3)go 2 lines dwn and copy the number " 64.999"
4)paste it into excel
file:me.txt
Dimension no: 1
Plane:PL1
Flatness 0.003 0.200 *---
--------------------------------------------------------------------------------
Dimension no: 2
Circle:CR1
Diameter 113.001 113.000 +0.000 +0.300 0.001 *--+---
--------------------------------------------------------------------------------
Dimension no: 3
Circle:CIR0
Diameter 64.999 65.000 -0.300 +0.300 -0.001 ---*---
--------------------------------------------------------------------------------
Dimension no: 4
Plane:PL1--Plane:PL3
Lengthavg 15.500 15.500 +0.000 +0.100 -0.000
View 9 Replies
View Related
May 30, 2013
I have links between Excel files and Word files. I use these files for multiple projects. When I copy them and paste them to a new folder the new files would be linked together. For some reason this has stopped. Now when I copy, the Word file has links to the original document, not to the copied document.
View 7 Replies
View Related
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
May 27, 2014
if I have one cell that ive enlarged to half the sheet.... and it is effected with rollover hyperlink so that when I hover over other cells. it turns different colours..
is it possible to make that cell open up different files using the double click event depending on the colour it currently is?
i.e. if its blue, open file1. if its yellow, open file 2 etc
View 4 Replies
View Related
May 14, 2013
Trying to write a script to carry out a number of tasks but is there code to enable an Excel to look in a particular file for the list of csv files - carry out the tasks and return the appropriate values in the Excel sheet whilst leaving the original csv files untouched?
View 2 Replies
View Related
Jun 26, 2009
Need a way to update a single master file. What happens right now is that the cost manager sends out one file to a lot of different project heads and then on having them return back to him he basically has to individually add in all the data. What i am trying to do is that he somehow carries on sending out the data as there are a lottt of projects and then on returning them they automatically update.
View 14 Replies
View Related
Jan 4, 2014
how I can loop through folders to select files starting with a certain word and copy all of them to a different folder and rename them. The folder structure is given below
Company 1(parent folder)
North South East(sub folder) West(sub folder)
Jan Feb Mar.... Dec Jan Feb Mar.... Dec Jan Feb Mar.... Dec Jan Feb Mar.... Dec
In the above structure, the files are present inside each folders Jan, feb...Dec under the regions North, South East n west. note that I have to select files starting with "Sales" and copy them into a new folder(say results) and rename copied files as Sales1.xls, Sales2.xls etc. (Files are not present in the folder company1, north, south, east and east.)
View 1 Replies
View Related
Jul 5, 2007
I want to allow users to place files (.jpg, .tif, .pdf, .pps etc) into a network folder and then have my program open each file and display it for 30 seconds then close the file and the application before opening the next file.
1. Set up a loop to get a directory listing of the folder and write the listing to a text file.
2. Open up the text file and get the next filename in it
3. Open the file in the associated application
4. Wait for 30 seconds (or some period of time) and then close the file
5. Repeat steps 2-4
DoIt = 1
While DoIt = 1
Open "C:TempList.txt" for output as #1
Print #1, Files In Folder
Close #1
Open "C:TempList.txt" for input as #2
while not eof(2)
Line input #2, MyFile
Display MyFile on screen
Wait for 30 seconds
Close MyFile and MyApplication that opened it
wend
Close #2
I can get the directory listing just fine with no problems
I can open the files in the associated application just fine with no problems.
with closing the application after 30 seconds or some period of time.
I need some code that will allow me to easily send it a filename and it will know how to close the file and the application that opened it.
View 9 Replies
View Related
Feb 8, 2009
I have an Excel application (Excel 2003) which is stored in the default Program Files folder by the Installer; for example: c:program fileszxchello.xls. The problem I am running into is this file opens as Read Only in Vista and this is interfering with the running of the application. There is no problem opening the file normally in Windows XP.
I have been able to narrow down the cause of this to the User Account Control system in Vista - if I turn OFF User Account Control, the Excel file opens normally and my application functions normally. Is there another option to open the Excel file without turning OFF User Account Control because some users may find it unacceptable to turn OFF this security feature. Ofcourse, one option is to install the application in another location, outside the Program Folder, and the file would open normally, but the Packaging Wizard that I am using to package the application does not allow me to install the application in any other location and thus, the application installs in the Program Folder and I am running into this problem of the Exel file opening as Read Only. Is there a way out of this situation where I can open the file normally (not as Read Only)?
View 5 Replies
View Related
Jul 13, 2006
I'm using the following code to import thousands of html files into my spreadsheet. The code is working fine. Since I am importing thousands of files, when there is no more space on my worksheet, the code stops with an error message. I want to make this code add another worksheet & continue importing the html files until there are no more files to import.
Sub Master_Importer()
Dim I As Long
Dim strFilename As String
Dim strPath As String
strPath = "file:///C:/Documents and Settings/c/Desktop/New Folder/"
With Application.FileSearch
.LookIn = "C:Documents and SettingscDesktopNew Folder"
.FileType = msoFileTypeAllFiles
.Execute
For I = 1 To .FoundFiles.Count
strFilename = Mid(.FoundFiles(I), InStrRev(.FoundFiles(I), "") + 1)
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & strPath & strFilename _ .......................
View 5 Replies
View Related
Apr 17, 2013
I require the code for the following task.
I'm getting an input string from the user in an excel sheet(e.g. input.xls) .I have to search for that string in a group of excel files present in the same folder in which the input.xls file also present.The range of that cell in which the string is found (e.g. A1 ) has to be stored in a variable.
I know that Vlookup is an option but the number of excel files to be searched is more that 50.
View 1 Replies
View Related
Nov 23, 2012
I have a folder with many subfolders and I want to search ".xls" files from these subfolders and then cut and paste them to new location. There is a code available over interned for searching files in folder but apparently it does not work in newer versions of Excel.
View 5 Replies
View Related
Aug 19, 2008
On this forum I read about the application "FileSearch" that doesn't work in office 2007. I used the macro on below in office 2003 and it worked. Now I upgraded to Office 2007 and it doesn't work. But if you search "NewSearch method" in the MS Excel Help you can find that the application exists and it has the same morphology I am using!! Why Doesn't it work??
With Application.FileSearch
.NewSearch
'Change path to suit
.LookIn = pPath
.FileType = msoFileTypeExcelWorkbooks
.Filename = "*.xls"
If .Execute > 0 Then 'Workbooks in folder
Redim FNameArr(.FoundFiles.Count).......................
View 2 Replies
View Related
Jul 29, 2006
I have patent numbers in column A of an excel sheet and would want to locate or search the specific text files (located in my D:Files folder) containing those values. If the value is found in myfile1.txt then the result should be outputted in column B containing the filename of the text file. For example:
Column A Column B
us20061234556b1 myfile1.txt
us20061434455a2 myfile2.txt
wo200612344556A myfile3.txt
View 5 Replies
View Related
Sep 21, 2007
I have a bunch of quotes in Excel format which have 5 columns ; Part number, Description, Qty, Cost, Total Cost, Unit List,Total List. I need a piece of code to open many excel files, look for a "part number" beginning with ED,DS,AP,MP or MDS and return the corresponding value in the "total cost" column then record the value in a separate spreadsheet.
View 2 Replies
View Related
Oct 5, 2007
I don't seem to be able to combine the looping through a set of workbooks with the IsFileOpen function posted by microsoft.
Basically this code works if the foundfile(j) is closed, but if it is already open I cannot activate the foundfile(j) and make it do things.
I'm not posting the ISFileOpen function because already present inside the forum and the rest of the code because it's too long...
With Application.FileSearch
.NewSearch
' . ScreenUpdating = False
.LookIn = MyPath(40)
'* represents wildcard characters
.FileType = msoFileTypeExcelWorkbooks
If .Execute > 0 Then 'Workbook exists
For j = 1 To .FoundFiles.Count
If IsFileOpen((.FoundFiles(j))) Then
'neither of these three options work
View 4 Replies
View Related
Apr 4, 2014
I'm having difficulty trying to get the second file appended to the bottom of the 1st imported file. I get "run-time error '13' type mismatch". There is no difference between the two files. I'm thinking there is a problem with my range statement in the second file import, but this range works fine in other macros. Here's my code so far:
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;\server1usersmydataIMPORT1.CSV", Destination _
:=Range("$A$1"))
.Name = "IMPORT1"
.FieldNames = True
.RowNumbers = False
[Code] .........
View 7 Replies
View Related
Dec 21, 2007
I have a excel file that I enter information into. I have code that saves the files to a certain folder with the name, date, and time stamp for the file name. At the end of the day I might have 3 to 15 excel files I have created that day and I would like to take information from certain cells (examle: L3, B6, B7, B8, G8, and so on) and create a txt file with all of the information in it.
Example:
12/20/2007
Your Name
123 Somewhere St.
Here, OH 45111
Home Visit
12/20/2007
Someone Else
345 Anywhere St.
There, OH 45211
Hospital Visit
View 9 Replies
View Related
Mar 10, 2014
Currently using the following code to "pull" a range data from a closed workbook.
[Code] ......
This works well if I know which workbook and sheet I will be getting the info from. What I would like to do is add a function that searches through a few workbooks looking for a worksheet name that matches a value in a cell in my original workbook.
ie. Workbook 1, cell A1 = "Jelly"
search through excel files for the workbook that contains the worksheet named "Jelly" and then copy a range from that worksheet back to workbook 1.
View 2 Replies
View Related
Jan 2, 2009
I cannot find Excel files that contain specific strings. For example, if I create a new file, and in the first cell type in "123456". Then save the file to the folder c:Temp Then in Windows Explorer, right-click on C:Temp and select "Search . . ." Then under "A word or phrase in the file", type in: 123456
It will NOT find the file! It will find a txt file or a doc file, but not xls files.
I thought maybe it fails because that is a number. But I have hundreds of Excel files with Integer numbers stored in "General" format cells and I desperately need to be able to search them to see which files contain certain numbers. It all started with some files that were sent to me - they work PERFECTLY for searching cells for numbers. So strange - yet if I open the file then save it . . . no changes or edits at all, just Open and Save. . . then the search fails for all numbers in that file. This is so perplexing that I have placed 2 zip Sample files on my website for you to Download: http://www.infocellar.com/Samples.zip
Unzip the two files to any folder. One is named "Sample-Works.xls" - Then do a Windows Search for any number in the file, here is one to try that is in the two files: 174026 And it will list "Sample-Works.xls" but it will NOT list "Sample-Fails.xls", even though BOTH FILES ARE IDENTICAL! I copied the same file twice and then named them. The only difference is that I opened the file Sample-Fails.xls and then immediately Saved it, which as I stated earlier, makes it fail all Searches from that point forward.
View 5 Replies
View Related
Feb 18, 2009
I have a list of file names sans extension in column A. I want to search a folder I specify and if file is found create a hyperlink to said file either in a new cell or in column A.
The code I have does the search fine, but its hyperlinking is offset and I can’t get it to match the link to the file name.
Also it breaks if it can not find the file.
Here is the code...
View 9 Replies
View Related
Jun 29, 2006
I want to search for some text in a file. If found, I want to copy that file into another folder. I'm using the code below to do half the job.
Sub test()
With Application.FileSearch
.NewSearch
.LookIn = "C:Documents and SettingscDesktop1"
.SearchSubFolders = True
.Filename = "*.htm"
.TextOrProperty = "Status Rekod"
.MatchAllWordForms = True
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
For I = 1 To .FoundFiles.Count
'I want to use the FileCopy function here to copy the found files to
'C:Documents and SettingscDesktop est. How do I do this?
Next I
Else
MsgBox "There were no files found."
End If
End With
End Sub
View 9 Replies
View Related