Find Text In Different Workbooks
Jan 31, 2007
I want to loop through all the open workbooks and search for a text and activate the cell that has the text. I try to use the following code but it doesn't work.
Sub findcell()
Dim wkb As workbooks
For Each wkb In Workbooks
wkb. Sheets(1).Cells.Find("sometext").Activate
Next wkb
End Sub
View 7 Replies
ADVERTISEMENT
Jun 1, 2006
I'm trying to fully automate a process for my team. So far I have a main workbook that imports files to Excel and puts them into 2 reports for us.
We then copy and paste separate sheets into their respective workbooks
I am wanting to create a button for both files to be emailed from our main workbook.
The two files have the same file name every day except the date is added to the end every day in format mm-dd-yy
The two filenames will always be ABC Flash Report and DEF Flash Report.
Is there a way for to search the directory they will be in(always be the same as well) and then attach that file to an email?
View 9 Replies
View Related
Sep 29, 2007
i have manage to get the loop through folders working ok via you freqently asked questions this macro is used to collate the total sum of expenses for travel, petrol, meals etc from all employees for that month.
the code used in the loop thro macro finds the data in row 35 of all the workbooks and puts it into the master file. see code below that finds the data in row 35. starting at column e and works fine
rCell. Offset(0, 1).FormulaR1C1 = wbResults. Sheets(1).Range("E35")
rCell.Offset(0, 2).FormulaR1C1 = wbResults.Sheets(1).Range("f35")
rCell.Offset(0, 3).FormulaR1C1 = wbResults.Sheets(1).Range("g35")
rCell.Offset(0, 4).FormulaR1C1 = wbResults.Sheets(1).Range("h35")
rCell.Offset(0, 5).FormulaR1C1 = wbResults.Sheets(1).Range("i35")
i have been asked to modify the expense sheets so that extra rows can be inserted as and when required ,this then could moved the total row ie row 35 to any row.
what i have in column "d" is the word "total " can the code by modified to search for the word "total" and fetch the range from "column e to column aa and copy it to the master workbook. There are 3 sheets in each workbook that have total expenses in them. there are also 3 sheets in the master workbook.
i have attached a copy of the expense file we all have
View 9 Replies
View Related
Jul 21, 2008
I have 2 open workbooks. I've picked up the filenames in VB.
One of them is strRemitN
Another one is strStateM
In strRemit i have invoice numbers (OP/I123456) in column A.
in strStateM the invoice numbers are in column C
How would i go around, in VBA, to search for the first invoice number from strRemitN to strStateM, delete the row, then go to the next, all the way to the bottom?
Dim intLRow as integer
intLRow = Range("A65536").End(xlUp).Row
View 9 Replies
View Related
Jun 11, 2009
I have 2 workbooks. and i would like to do the following:
Workbook1
- 4 columns (product ID, quantity, Group, Comments)
Product ID, Quantity, Group, Comments
11111, 500, ?,?
11122, 1000, ?,?
11133, 250, ?,?
11144, 250, ?,?
11343, 700, ?,?
12134, 750, ?,?
Workbook2
- 2 columns (group A, Group B)
for group A:
min qty: 250
min increment: 250........................
1) I need to match the product ID in workbook1 with workbook2 - see which group it belongs and put into workbook1 under column group
2) I need to count the no.of quantity and see if it meet the citeria and place Yes/No in workbook1 column under Comments.
- for example:
product ID 11111 in workbook1 can be found in workbook2 group A (put group A into workbook1 under column group)
do a check: prodct ID 11111 has 500 in quantity, since its under group A it meets the min qty of 250. and followed by it meets the min increment too - 500/250 (thus put Yes into workbook1 column under Comments)
View 9 Replies
View Related
Oct 24, 2006
I have two worksheets in two separate workbooks. One contains only two columns - a list of codes and the corresponding name of an institution. The other workbook contains a column with the codes. I want to replace the codes in the second workbook with the names from the first workbook.
I found this code on [url] here: Find & Replace macro
Sub DoIt()
Dim rRange As Range, rCell As Range
On Error Resume Next
With Workbooks("Personal.xls")
Set rRange = .Sheets(1).Range("A1", .Sheet1.Range("B65536").End(xlUp))
End With
For Each rCell In rRange.Columns(1).Cells
Selection.Replace What:=rCell, Replacement:=rCell(1, 2), _
LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False
Next rCell
On Error Resume Next
End Sub
This is exactly what I need, but like the last person who asked about it, I can't get it to work. I've gone through Dave's instructions a number of times, and now I'm stumped.
View 5 Replies
View Related
May 7, 2007
I have two workbooks Raw File and Lookup_Test, I want to find the value of Column A from Raw File, in Column A of Lookup_Test, if the value if found then i want the value in Column D from Lookup_Test, to be copied to the Column B of Raw File .
Well its like using vlookup , however i am trying to avoid using Vlookup and find any other way of doing the same.
View 9 Replies
View Related
Aug 21, 2007
I am trying to find out if it is possible to create a macro in an excel workbook that will open another workbook saved on the computer, perform a find, copy specific data, and paste it in the opened/active workbook.
View 8 Replies
View Related
Oct 4, 2006
Is there a way of finding all files in a directory which contain a macro? I have script which will loop through all files in a folder but I don't know, and can't find, the appropriate syntax for referencing macros/modules.
View 9 Replies
View Related
Feb 19, 2008
I have two workbooks, (Invoice.xls) and (Inventory.xls) both using sheet1. When I fill out an invoice, with lets say 10 items on sheet1 column B, I need a macro to find those items in workbook "Inventory" sheet1 column A. When the item is found, I need the qty I entered on the invoice workbook "Invoice" sheet1 column C (same row as the item number) to be subtracted from the current total for that item in workbook "Inventory" sheet1 column C. I would like to run the code from the workbook "Invoice" before I do a "Save As".
I have found other Vb code on this site that seems very close to what I need, but I just don't know enough to make the changes necessary.
View 5 Replies
View Related
Dec 23, 2013
Book 1 sheet1 A
1234567
1234567
2658798
4083029
5507260
6931491
8355722
9779953
11204184
12628415
14052646
15476877
16901108
Book 2 sheet1 A
2658798
4083029
5507260
6931491
8355722
26587965
26365785
26143605
25921425
25699245
25477065
25254885
25032705
24810525
I need get the result Book 3 Sheet 1 A
All duplicates items from book 1 and book 2
View 6 Replies
View Related
Jul 15, 2009
Is there a way to find and replace the values from a closed workbooks of a folder.
say i have some 15 files in a folder c:/test
I want to find all "Ltd" and replaceAll with Limited
and find all "Co" and replaceAll with "Company" etc (some 20 different values to be found and to be replaced) if this is in a single file i can easily record a macro to this job, i am stuck for doing 15 files at one shot.
View 9 Replies
View Related
May 23, 2006
I am having trouble getting my IF statement to test if the cell contains the text "sale" return "X" if not "Y". I need it to search through the text string in that cell and find a certain word, and if it finds that word, retrn a value. I am really having difficulty with is what symbol or function do I use for the logical test? (i.e. =, <>, MATCH, INDEX?)
View 4 Replies
View Related
Oct 8, 2006
Attempting to hide columns (of cities) via VBA generates an error when that same city is reselected (either individually, or as part of the group) in the list box, upon clicking the 'Hide' button.
The error happens at this point: ...
View 3 Replies
View Related
Sep 3, 2006
What is the need for storing information in a text file instead of just keeping the data in excel on a worksheet or in vba code.
for example.
I have a file that was given to me that on the OpenWorkbook event runs through an "INI read " procedure. All this does in get certain data from a text file such as:
file paths, rates, file names
Is there any need for this as you could easily store the same information on a worksheet and declare variables in the code.
View 9 Replies
View Related
Jun 13, 2008
I have wrote a few macros before which involved searching, copy pasting and comparing.
I now need a macro that can first open a text file, in this text file will be 6 section separated by 6 different titles so it will look something like this
title1
467575
56
56745
547
575
title2
65ryret
ryr534............
View 9 Replies
View Related
Jan 7, 2014
I have an existing Cash Flow Report that has a column of abbreviated/shortened (WBS Element) title where each cell contains a unique three lettered/numbered amount of characters (Example: 200). These three abbreviated character cells are specific and relate to their full/longer (SAP WBS Element) title (Example: WBS DWRRI-BW066-200).
In my attached excel model (Find, Locate, and Align WBS Elements to Cash Flow Report.xlsx), I need a formula for the, "Cash Flow Report WBS Elements" sheet in cells B3 thru B11 that will look at the abbreviated three lettered/numbered (WBS Element) titles in cells C3 thru C11, then search and recognize its unique counterpart contained in the, "SAP WBS Elements Export" sheet and return this full/longer (SAP WBS Element) title to the, "Cash Flow Report WBS Elements" sheet in cells B3 thru. B11, just to the left of its abbreviated/shortened (WBS Element) title.
View 3 Replies
View Related
Jan 7, 2014
I have an existing Cash Flow Report for my work that has a column of abbreviated/shortened (WBS Element) titles where each cell contains unique three lettered/numbered characters (Example: 200). These three abbreviated character cells are specific and relate to their full/longer (SAP WBS Elements) titles (Example: WBS DWRRI-BW066-200).
In my attached excel model (Find, Locate, and Align WBS Elements to Cash Flow Report.xlsx), I need a formula for the, "Cash Flow Report WBS Elements" sheet in cells B3 thru B11 that will look at the abbreviated three lettered/numbered (WBS Element) titles in cells C3 thru C11, then search and recognize its unique counterpart contained in the, "SAP WBS Elements Export" sheet and return this full/longer (SAP WBA Element) title to the, "Cash Flow Report WBS Elements" sheet in cells B3 thru B11, just to the left of its abbreviated/shortened (WBS Element) title.
Find, Locate, and Align WBS Elements to Cash Flow Report.xlsx
View 1 Replies
View Related
Aug 18, 2013
I am trying to find specific text throughout an excel document (2007) and replace it with the same text but in italics. I tried using the options/format function and selecting italics for the "replace" text but it replaces the entire cell text in italics instead.
View 5 Replies
View Related
Mar 8, 2013
How do I use an Excel formula to find which (if any) multiple sets, each of up to 50 words, exist in a series of rows of a spreadsheet - if set A has one or more words found in a searched cell.
A positive result will return a specific value in the designated result cell. If none of the words in Set A is found in the searched cell, the formulae will repeat the test for the words in Set B, and so on.
After all 50 sets of words have been tested, the formula will move to the next cell in the searched column.
New words will be added to the sets of words continually as required.
Multiple words within sets are included in double quotes. Within each set of words there will be some n-tuples of words (i.e. 24 adjacent words) that contain one or more of the words in the set, but for which the formula will be required to return a negative result. Example: Set A = word 1, word2, word 3, "word1 word2 word3". (The words within a set could also be each entered in separate columns, as opposed to all included in a single cell.) The single column of text to be searched is about 10,000 rows.
I am wanting to use the above in a spreadsheet that contains data downloaded from a series of bank accounts to automatically allocate items of expenditure to one of 20 or so different categories of expenditure.
The formula will search the description field to find words that are used in the in the downloaded files from the various accounts to describe each transaction.
If a word describing travel expenditure (e.g. hotel, "holiday inn" but not "holiday travel") is found in the description of an expenditure item - the item cost will be allocated to the TRAVEL EXPENDITURE column, which is one of 20 or so different categories of expenditure.
Happy to consider a different solution if the task can be done better a different way.
Tried using a combination of INDEX/SEARCH/IF in Excel, but was not able to get a correct result. PS I am using Excel 2011 for Mac - which does not allow macros, so the solution needs to be entirely formula based.
View 1 Replies
View Related
Nov 8, 2008
That does allow me to filter the output in Master, but ideally what I would want to do is not have to set aside 300 lines in the Master file for each of the Staff files. Conceptually, I'd like to have the spreadsheets Staff A, Staff B, etc. look for and export only lines which have data in them and then have Master bring those lines in automatically. This may not be possible, in which case your suggested solution is the best approach.
View 9 Replies
View Related
Mar 4, 2014
I have a worksheet with several columns. I need a formula to search column D only and each time a specific location is identified to replace that location with alternate text. Example (ORIGNAL TEXT):
Column Dtext to text help.xlsx
BIRD
FISH
DOG
BAT
BUG
I need to search that listing and each time the word BIRD is mentioned have it replaced with FEATHERS and each time DOG is listed have it replaced with TAILS Final result would look like:
FEATHERS
FISH
TAILS
BAT
BUG
All other text should stay the same and replacement text should appear in the cell of the text it is replacing. This is a sheet used by multiple people several times a day and so the Find/Replace option really won't work.
Have working on this for at least 6 months and it just isn't going to happen for me. I thought I could use a Conditional format, but that is producing no results either.
View 3 Replies
View Related
Apr 22, 2006
I am using the following code.
Function VLOOKUPRow()
Dim SV As Object
Worksheets("Midterm").Select
SV = "UserFormAppend.TextBoxInvID.Text"
VRow = Columns(1). Find(What:="SV", After:= Cells(1, 1), _
LookIn:=xlValues, SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, MatchCase:=True).Row
MsgBox (VRow)
End Function
I am trying to give the VRow variable the value or the row that The text from my text box is on. How do you make the what look for a variable. I can get it to work if i put a constent in the what. how to make the what look for a variable. I'm new at this forum thing so im not quite sure how to check for answers.
View 2 Replies
View Related
Apr 10, 2008
I want to search for a word in column A and when I find it I want to copy it to column B.
Column A is a description that can be 6 or 7 words long. Column B is a single word.
Example:
Col A
Engine Kit, V-8, 306, forged.
I need to copy the word Kit to column B.
View 9 Replies
View Related
Dec 7, 2012
I have a large .txt file that I would like to edit using VBA. What I would like to do is to find each of the following text strings in the text file :
De:
De :
Envoye
A:
Objet:
If the character right before those text strings is not a carriage return (chr(13) then add a carriage return.
I would like the code to read each line in the text file and execute the task mentioned above.
View 9 Replies
View Related
Mar 5, 2008
i am trying to do a search and i came across this. In the excel file attached you will see 2 column. Now if you take copy and paste "sterling rd" which is standing alone into the crtl F search field. It wont find it.
I have played with the format (made both general), i have CLEAN, Proper the text and tried that didnt work either.
I dont know what else to try. I am working with access, with a much larger list, however the linking to excel wont work and i know there is some difference font or format that i am missing.
View 5 Replies
View Related
Jun 18, 2014
I'm trying to set up a dashboard with a table and some formulas so that I can just copy a data export into one tab and have the table perform various Vlookups, charts, etc. The trouble I'm having is that some of my cells contain a mix of text, and I'm looking for specific text only. Example:
Address |Tags | Result
Email 1 |t1 t2 t3 t4 | Email 1
Email 2 |t1
Email 3 |t2 impact1 | Email 3
Email 4 |impact2
Email 5 |impact2 t2| Email 5
My data source has thousands of rows, and I'm looking at the Tags column. I want to use a Vlookup that gives me the email when [Tags] contains "t2", but my search is getting confused with "impact2". Is there a formula to search for "t2", but not get confused with "impact2"? I considered using =NOT, but I don't want to exclude cells just because they contain "impact2". If there was a formula for =IGNORE, that would be marvelous. My formulas are getting longer & longer, but they always seem to break in the end.
Basically I'm trying something like:
=IF(OR(ISNUMBER(SEARCH("* t2*",Table1[Tags])),SEARCH("t2*",Table1[Tags])),"Yes","No")
(Once I get the IF figured out, I'll use Vlookup to bring out the Address).
View 1 Replies
View Related
Oct 15, 2008
I have a couple of excelfiles in which someone made a flowchart with text boxes. I would like a search code that would help me find a text or number in those text boxes. The CTRL+F function only works on cells. Does something similar exist for text boxes? Or can this be made in a macro?
View 9 Replies
View Related
Dec 9, 2009
The macro recorder doesn't let me record a macro that finds text box #9, go to the end of the existing text in the text box and then add my text.
When I record the macro and go to the box, it doesn't appear in the code (as well as not working).
View 9 Replies
View Related
Aug 27, 2006
I'm trying to create an Excel function that allows me to choose a row from a table based on text found within entered data. For example, say I have a table called "categories" that looks like this:
Categories
cat
dog
mouse
Now in a different section of the workbook, I want to be able to enter an arbitrary number of sentences, one per row, that look something like:
"It's raining cats."
"The mouse is hiding."....................
View 3 Replies
View Related