Searching For File On All Drives
Jun 15, 2007
The Code below searches for a file and displays how many files by that name it found.
Sub Test()
With Application.FileSearch
.NewSearch
.LookIn = "C:"
.SearchSubFolders = True
.Filename = "Temp.txt"
If .Execute > 0 Then
MsgBox ("Success: " & .FoundFiles.Count)
Else
MsgBox ("Fail")
End If
End With
End Sub
However, Flashdrives are a common use among those that will use the code, such that I need the code to not only search the hard drive C: but all hard drives and flash drives. Using .Lookin = My Computer did not find the files stored on my Flash Drive.
It finds it using .Lookin = "K:" but I can not rely on my flash drive always being K:. It does not find it using .Lookin = "PumaFlash" (Name of flash drive)
I'm looking for one of two things: Code that will Search all hard drives and flash drives (optical drives can be included) at once Code that will Find path for all hard drives and Flash drives and then search them separately
View 2 Replies
ADVERTISEMENT
Nov 26, 2008
I have a number of project files that are maintained on the network.
These files are named "XXXXXX Project Name.XLS".
XXXXXX is the project number. This numbers are unique, so there is only one file per number within the directory. Project names are mostly unique, but sometimes they could be same for a specific site.
We recieve financial data in excel file format from home office. These reports reference only the project numbers, not the name.
I have created an excel program that extracts project numbers and related financial data from the report [from home office].
I would like to create a button or check box next to each project number in my program and link it to the respective file on our network. Once I access the local file on the network I could copy the financial data in its right place.
The problem is opening the file based on project number only, while the file names contain Project Name as well.
So, can I look up a file by only searching for first six characters of the name?
Or can the Hyperlink function work with some sort of wildcard? I can write the formulas to create the hyperlink and then write a macro to look for that file, but I need to be able to find and open the file by looking up only the first six characters.
View 9 Replies
View Related
Jul 14, 2009
I have been asked to fix a macro that is supposed to search column B and find any cells ending with .mov. Any row fitting the criteria is to be copied to Sheet2. The file is a internet traffic log and we are trying to determine the number of downloads we have on our video files, which are all .mov format. Sheet1 can exceed 3000 rows.
Here's what I have so far:
View 2 Replies
View Related
Dec 11, 2013
The sub i'm currently using does an instr search for a unique string in an xml file. This works fine but i'd like to speed up the search if possible because I have a large number of xml files to search. My problem is that i have very little experience in parsing xml.
I notice that if i load the xml file and look at the namespaces i see item(1) through about item(20) and the unique string is always contained in one of those items. Note that the number of items can be different for each xml file i load.
The xml file is loaded into an object i define as oInstance and i'd like to do something like:
Do
counter = counter+1
if oInstance.namespaces.item(counter) = uniquestring then[code]....
but now i get Err.Number 91
View 9 Replies
View Related
Sep 12, 2006
I wrote some code which has compiled a LOT of text files telling me what computers have licence for certain software.
The name of the txt file is the computer name and data within is simple:
--------------------
Audit of GQL license
Audit of Visio license
Audit of Frontpage license
Audit of Project license
Audit of Visual .NET license
Audit of Word (Office) licenses
Found Office
--------------------
as we can see here this computer has 1 licence for OFFICE.
If the string "FOUND" is found then i want to be able to paste the licence name in a spreadsheet and in the next cell underneath paste the filename it was found in the e.g.
VISIO
comp1,comp2,comp3,comp4
WORD
Comp2, comp3, comp4, comp5....and so on......
View 9 Replies
View Related
Nov 7, 2008
I have a issue at work where I can Map Drives but then when i reboot/log out the drives do not re-map. I have checked "Reconnect On Logon" but that does not work. I have called up IT and they just beat around the bush.
I am wondering, if there is a way for me to create a Macro to Map drives?
Also, for the macro to check if the drives are already mapped, if so then map it, if not then to skip mapping this drive.
I am hoping this can be made as convenient as:
X = C:Documents and SettingsPratikDesktopTest1
B = C:Documents and SettingsPratikDesktopData2
Where the X / B specify the drive letters.
View 14 Replies
View Related
Jun 5, 2009
is it possible to type a document name in a cell,then run a code that searches a root dir and sub folders, find the existing document and open it?? for example
cell: "D20"
filename: DYAZES-001
root dir: "I:IsolationDataBaseIsolationProcedures
subfolders: DryMillA, DryMillB, Despatch, Maintenance
View 5 Replies
View Related
May 6, 2009
I read in a txt file with the code below. There's some kind of special character in the last 3 lines of the input file that makes the macro crash. I don't need anything in those 3 rows. How can I delete them before my Do Until loop?
-----
Sub Mytxt()
Dim Mytxt As String
Mytxt = Application.GetOpenFilename(FileFilter:="EXCEL files (*.txt),*.txt", Title:="Open the Report file you need")
If Mytxt = "" Then Exit Sub
Workbooks.Open Filename:=Mytxt
Open Mytxt For Input As #1
i = 1
Do Until (EOF(1) = True)
Line Input #1, tempstr
Cells(i, 1) = Mid(tempstr, 23, 5)
Cells(i, 2) = Mid(tempstr, 25, 1)
Cells(i, 3) = Mid(tempstr, 33, 3)
i = i + 1
Loop
Close 1
End Sub
View 9 Replies
View Related
Oct 11, 2013
I am trying to write a macro to open a specific file, but need to search multiple folders within folders to find it.
The file name I need to open is "Escalation Adherence-Details " & Format(Date, "mm-dd-yy") & ".xlsx".
I need to drill down to the Adherence Report folder and then have the macro search through folders for each year (2012, 2013, 2014, 2015, etc) and then each month within each year (1 January, 2 February, 3 March, etc), at which point I would then find that day's file.
So far I have the following:
Code:
Sub Open_ESCL_Report()
Workbooks.Open Filename:=*****.****.****.******.comsharesPurchasingTeam XEscalationAdherence Report & "Escalation Adherence-Details " & Format(Date, "mm-dd-yy") & ".xlsx"
End Sub
Each file is stored in it's respective month folder as .....Adherence Report(Year)(Month)(File).xlsx
View 3 Replies
View Related
Nov 20, 2007
I have 5 worksheets in file Z on drive J which are full of VLOOKUP formulas pulling data from several files on drive K. Each worksheet pulls data from it's own file on drive K...ie, worksheet AB pulls all of it's data from file AB_2008, etc. On worksheet CD there are two rows which populate with #N/A when I open file Z, but if I open file CD_2008, the #N/A's automatically populate with the correct values. Any ideas??? I am not a programer but I have pretty fair excel skills...but this one has stumped me.
Here's my formula:
=VLOOKUP($A19,'K:sopworkbookssop_2008[sop_2008_rt.xls]11-RT-PPR'!$A:$BQ,C$34,FALSE)
View 9 Replies
View Related
May 27, 2014
My office just upgraded from office 2007 to 2013. I went through my normal routine, adding back in settings and Add-ins. Everything seemed fine. I rely heavily on Aaron Blood's Explode Add-in. It seemed to work. If I open a local spreadsheet it works (same with ledger shade and some other personal add-ins). However, when I open a file on the network, the explode and ledger shade add-ins do not appear. My personal add-ins do, but I have set myself as a trusted root source. I am sure I have a security problem somewhere.
I went into the trust center/trusted locations and set my network drive (and it's subfolders) to be a trusted location. That did not seem to fix it.
I also tried copying a file that does not work on the network to my local drive to see if the add-ins would work - once on my local drive they do work. Also if I open a blank or local file, then open a network file, the add-ins are still there and working.
View 1 Replies
View Related
Nov 5, 2012
how to create a list of the drives on my computer using VBA. Maybe I missed something.
View 2 Replies
View Related
Nov 9, 2009
I currently have this code that allows me to print a word document on one of my drives with the click of a button in excel. I need to modify it because one of the files I want to print as well is a pdf file. how to modify it so I can do that?
Set appWrd = CreateObject("Word.Application")
Set docOpen = appWrd.Documents.Open("F:groupsdeptservCDTISA.doc")
docOpen.PrintOut
docOpen.Close
appWrd.Quit
View 9 Replies
View Related
Oct 13, 2009
I have doc with app 1000 rows of data, one col being product description. I want to simply search the entire description column for a particular string of characters and enter a 1 in a new adjacent column where there is a match. Where there is no match, I want a 0 or a blank.
View 3 Replies
View Related
Apr 24, 2007
I'm wondering what function I can use to search a specific word in row with many text?...
i attached for the example and details.
View 10 Replies
View Related
May 10, 2007
I am trying to create a search facility to search for accreditations.
currently my search only picks up on the first word in the cell.
ie Prince will be found in Prince 2 Foundation, but a search on foundation comes up with nothing.
How do i get the search to search all the text in the cell and not just the first word.
I am searching on a number of worksheets but in the same range on each worksheet.
View 9 Replies
View Related
Jun 26, 2007
I need to be able to search through category(column H) and match with machine size category. Then for each category split up total time spent on each function. Granted this will be 6 formulas. I've searched through the forums and came up with what I have....
View 10 Replies
View Related
Aug 14, 2008
I have 180,000 names in a spreadsheet with unique codes for each, I need to search for names and find their code numbers, how can I do this over a series of 8 columns.
Code Name code Name code Name Code Name
I'll need to search columns 2, 4, 6 and 8 for the name?
View 9 Replies
View Related
Mar 3, 2009
Have the following scenario I'm struggling with in Excel 07:
2 worksheets:
WS1, have a bunch of customer data. Relevant columns in this WS include customer number (unique value) and a column called "adjustment date", which is formatted as a date as the label name implies.
WS2 is a bunch of customer transactional data, with each row being a unique transaction. Relevant columns here include customer number (formatted same as in WS1) and transaction date.
Couple things to note: in WS2, each customer may have dozens of transactions. Right now, I have that WS sorted by transaction date in ascending order (so oldest to newest).
What I'm trying to do (unsuccessfully so far!) is build a formula in WS1 that says "on what date was the customer's first transaction after their adjustment date"?
I've tried constucting something using =index+match, but to no avail.
View 10 Replies
View Related
Jul 24, 2009
I have a workbook with 100+ tabs(not in alphabetical order), and am constantly scrolling back and forth looking for tabs, is there a quicker way to search tabs? I have also right clicked the arrows to pull up the box with all tabs, but not the best option either.
View 7 Replies
View Related
Feb 3, 2007
Just trying to find a formula to look for duplicate entries in the same workbook or a single column
View 2 Replies
View Related
May 20, 2007
This is my problem:
Column A contains letters
Column B contains numbers
Column H contains data
I need a formula that will do the following:
Lets say cell M1 contains a certain letter, and cell N1 contains a certain number. I need to find the row on the spreadsheet that has the letter shown in M1 in column A and number shown in N1 in column B. Once the row is found, I need to return the data in column H of that row.
View 5 Replies
View Related
Feb 16, 2013
I want to bulid a code that enables me to open windows search result with a search string I define from excel data.
For example, I have folder path "X:workers".
In it, I want to search all the files with the string "dave".
The search string source is a cell in excel.
View 2 Replies
View Related
Sep 20, 2013
I have a program that creates a query of data into two different spreadsheets.I wish to create a master page that automatically searches for data in each of two spreadsheets and add them appropriately to the master page.
I get how to do such thing using vlookup to search for data in one spreadsheet, how to do that in two spreadsheet situation.Here is a formula that I am stuck on...
=IF(ISERROR(VLOOKUP(A2,Sheet1!$A$2:$B$3,2,0)),VLOOKUP(A2,Sheet2!$A$2:$B$3,2,0),VLOOKUP(A2,sheet1:$A$2:$B$3,2,0))
View 1 Replies
View Related
Jul 2, 2014
Goals
*VBA - code
*Search down a column of Serial numbers that are in numerical order....Column A,B,C........
*find the last duplicate and the row of that SN
3301
3301
3301
3301
3301 <---What row is this
3302
3302
3302
3302<---What row is this
*Then Store that row number in a variable like a,b,c,
View 2 Replies
View Related
May 13, 2014
I am trying to find a particular text in a column in excel. Below is the sample data.
Column A
ABA
ABA
ABC
ABC
ABZ
ABC
ABC
ABA
ABA
I would like to return TRUE/FALSE or 0/1 in Column B, B1, only if entire Column A contains atleast one ABZ. Tried search() & Find() but no luck.
View 1 Replies
View Related
Jul 29, 2014
I'm trying to print score cards from the scores sheet (two different worksheet pages). Some score cards (each score card is one page) will only have 3 players and some will have up to 5 players so I can't just go down the list and use a formula to transfer data line by line. I will set the score sheet up I just all of hole 1 players to be printed on a card and so on with hole 2-18 also I need First and Last names on the cards and possibly score total by the name.
Graphic1.gif
View 5 Replies
View Related
Feb 17, 2014
I have this data and want to extract the character after the letter Y if the string has a Y in it.
Example data Output
AU 2013 OD ANR B24 Y2 2
AU 2013 OD ANR B24 Y4 4
AU 2013 OD ANR B24 Y5 5
AU 2013 PD HLD NOV B SPA
AU 2013 PD HLD NOV C SPA
AU2013OD ANR B25 Y1 1
AU2013OD ANU B25 Y5 5
AU2013OD WCR FPVN B49
AU2013OD Y6 FPVN B49 6
AU2013OD WCR FPVN B40
AU2013OD WCR FPVN B43
View 6 Replies
View Related
Apr 28, 2008
I want to test a cell for the type of value as 678/256 or 345/872/098/987 etc. The common character in each would be the "/". First, I need to check the cell for this, then take the first number and compare it to an integer(if it is <> , or = to). I hope I am clear with my situation.
View 14 Replies
View Related
Aug 10, 2008
ive got table consisting of about 4000 entries. Below is a small example.
[url]
I want to be able to make a button through macro's, where when pressed, it shows only certain postcodes - the way i've been doing it so far is using a combination of If, And, and Or functions to return true or false if a postcode begins with either 'AH4, AH1' and has an order number beginning with 'W', for example. Then I'd record a macro where it shows the ones showing true, via data filter. The problem I've got is I need to search for about 50 different combinations of postcode, out of a list of maybe 300 types of postcode, and using my current IF,AND,OR functions, I simply run out of room in the formula bar! For example, I need find a postcode beginning with CB1-25 (i.e. CB1, CB2, CB3) etc..etc.. the only problem is if i use my current LEFT function, and i want to search for say, CB1, CB14, CB15, out of a list of 'CB1,CB14,CB15,CB16', it will still return a postcode beginning with CB16, due to the CB1.
In the link I've highlighted the postcodes I want to search for out of that small list, and hopefully any solution I'm giving here I could expand to up to 100 combinations out of 500 combinations of postcode, for example.
How do I get it to search for a massive combination of criteria?
View 14 Replies
View Related