Error 91: Find Locating Text On Another Worksheet

Oct 31, 2006

I have a single button on a spreadsheet. When clicked, it gives me Error 91: Object Variable or With Block Variable Not Set. This is the button's


Private Sub Analyze_Click()
Dim TextToLocate As String
Dim Searching As String
Dim TechNum As String

TextToLocate = "Mobile Device : "

Fname = Application. GetOpenFilename("@Road Excel Files,*.xls", , "Open @Road Log File")
Workbooks.Open (Fname)

' Error here at cells.find:
Searching = Cells.Find(What:=TextToLocate)
TechNum = Replace(Searching, TextToLocate, "")
TechNum = Left(TechNum, 5)
MsgBox TechNum

End Sub

The purpose of the code is to:Allow the user to open a log fileIn the newly opened log file, find the string "Mobile Device : "Following "Mobile Device : " is a tech number. Strip out "Mobile Device : " and grab the first 5 characters of the tech number.Show me what the tech number is in a message box
If I insert the code into the actual log file (no button and no opening of files), it works fine. I searched this forum and others and used everything I learned to find a solution, but the error remains.

View 9 Replies


ADVERTISEMENT

Find And Replace Formula For Locating Short Text Within Larger Text?

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

Find And Replace Formula For Locating Short Text Within Larger Text

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

Locating A Button On Worksheet

Dec 24, 2012

I want to assign macros to buttons from VBA. I know that buttons have a TopLeftCell property and I've used this before to point at cells around the button but not the other way round.

What I'm trying to do is have excel assign a macro to a button when the workbook is created (if thats possible - if not then just whenever it's opened the macro can be reassigned).

The recorder gives me the line of code:

Selection.OnAction = "ThisWorkbook.ImportJobsButton"

so I really want to change Selection for something that points at the specific shape. I want to do this with a few shapes.

View 1 Replies View Related

Find String Within Worksheet & Handle Error If Not Found

Jun 17, 2008

this line

Cells. Find(What:=searchterm, After:=Cells(1, 1), MatchCase:=False).Activate 'find pn that is stored in searchterm

causes a runtime error 91 when there are no results. "Object variable or with block variable not set"

Ideally, when there are no results, I would like to enter a loop, where I could provide a drop down list of fuzzy matches, but I am not sure excel can do fuzzy matches. I'd settle for just highlighting the row and moving on... any help?

Option Explicit

Sub Macro1()

ActiveSheet.Cells.Find(What:="AES", After:=Cells(1, 1), MatchCase:=False).Activate 'find the aes part number column
Dim aescolumn 'create variable for index value of aes column
aescolumn = ActiveCell.Column 'set variable to index number

View 3 Replies View Related

Excel 2007 :: Find Text And Replace It With Same Text Only In Italics In Worksheet?

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

Handle Find Macro Error When Text Is Not Found

Mar 1, 2008

I have the following macro which I've pieced together which works great at clearing the cell as long as the text entered by the user is found in the specified column.

Unfortunately I'm a big rookie with this stuff and I can't figure out how to handle the process/error when an entered value is not found. When ChosenRow returns with a 0 I get a Run time error '91', Object Variable or With Block variable not set.

The code...

Private Sub CommandButton1_Click()
oldSheet$ = ActiveSheet.Name
Dim ChosenRow As Long
Dim loc As Variant
Application. ScreenUpdating = False
With UserForm4
loc = .TextBox1.Text
End With
With ActiveWorkbook
Sheets("Reference").Select
End With

View 5 Replies View Related

Excel 2010 :: Locating One Cell Data In Text Of Adjacent Cell?

Jul 1, 2013

I am using Excel 2010.

In my worksheet I have 'Column A' and 'Column B', In 'Column A' are product I.D. numbers. In 'Column B' is a text description of the product, whose I.D. number is in 'Column A,' and should also contain the I.D. number from 'Column A' somewhere in the midst of the descriptive text. However, some of these in 'Column B' do not.

I need to create a function that looks for the value in 'Column A' and determines whether or not it is present in the text of 'Column B'. Therefore, spitting the answer out in 'Column C' so that I can copy it down for 100,000 cells.

View 5 Replies View Related

Find Text In A Worksheet

Dec 9, 2009

I want to find a text "Style#" in a worksheet and return the value next to "Style#". The value is supposed to be returned in, say, column H, for each row I found the text "Style#".

Below is the sample:....

View 10 Replies View Related

Find And Replace Text On Worksheet

Nov 11, 2011

I need some vba coding which will find and replace text on a worksheet. This would normally be straight-forward, however some text needs to be replaced by text which already occurs in the worksheet, and without it changing as well (if Find/Replace can perform two Find/Replaces at the same time???).

Here is the detail and what I am trying to accomplish: I have two worksheets each with a table of data.Worksheet 1 has a lookup table with three columns of data (column a and b are lists, with c being a formulated column which is dependent on the user selecting either column a name or column b name). I have done this easily enough using data validation on cell $C$1.Worksheet 2 has a user input table which column 3 is a dropdown validation using the named range "UsedName" from Worksheet 1.

I want the selected dropdown names to automatically change when the user changes Old Name to New Name (and vis-versa) on Worksheet 1.The list of values in the data validation dropdown list change well enough, but not any of the existing returned values. When I tried to use vba coding to Find & Replace, I run into issues because (Substanital and Important) are used in both instances, but at different levels with different matched names Important/Relevant.

Worksheet 1
A B C D
1 Cell with dropdown list New Names
2 (Old Names, New Names)
3
4 Old Names New Names Names Level
5 Equal Equivalent Equivalent 1
6 Dominant Critical Critical 2
7 Important Substantial Substantial 3
8 Substantial Major Major 4
9 Relevant Important Important 5
10 Minor Irrelevant Irrelevant 6
formula for column C =IF($C$1="Used Names", A5, B5)
column C is name ranged "Names

Worksheet 2
(Worksheet 2 has another table which has various data. One column which is a drop down list being pulled from Worksheet 1)

A B C D
1 Bob 25% Critical 19
2 Frank 60% Important 33
3 Ellen 40% Substantial 5
4 Ellen G 20% Substantial 12
5 Gary 55% Equivalent 100
6 Jo 50% Major 8
7 Peter 40% Important 22
8 Kim 12% Equivalent 30
9 Shelley 75% Substantial 15
10 John 75% Critical 90

so I want column C to automatically change from these New Names to the corresponding Old Name of the same level. So Critical would become Dominant, Important would become Relevant and Substantial would become Important.

View 7 Replies View Related

Find Last Cell In Worksheet Containing Text

Mar 26, 2008

I have seen a few examples which find the last used cell... but these seem to grab cells that have formulas in them, even though no text has been entered. I need to know how to find the last cell in a worksheet that contains text.

View 6 Replies View Related

Find Date In Worksheet & Return Text Accordingly

Mar 9, 2008

Working with project information which is about 1,000 project. I have two worksheets one has the start date/finish dates for each phase of a project -Define, Measure, I, Analyze, Control. Depending on the date I need it to be read and insert a value in my summary worksheet. The summary sheet contains the 12 months. I need the formula to read two columns start/finish, if the month is the same as the header in the second report return a letter of D, M, I, A, C if not leave blank.

View 9 Replies View Related

VB Code To Find Instances Of Text In Worksheet And Colour Entire Row

Aug 21, 2012

I'm trying to develop code that will perform the function in the title. I want to use an if statement that looks at cells across the worksheet and where it finds certain text it should colour the entire row. I would also like to be able to input the text via a user box. I don't necessarily want the code

View 3 Replies View Related

Macro To Find Text Within XLS Files And Output Data To New Worksheet

Oct 4, 2012

Need macro to search xls files in folder/directory for common text string "see reference" and then output the file number which is located in cell A1 to new spreadsheet for each file the text "see reference" is found.

View 6 Replies View Related

Find TextBox Text In Worksheet If CheckBox Is True / Checked

Feb 24, 2008

I have a userform where the textbox already pulls data from a worksheet. I have a checkbox next to the textbox, If the checkbox is true it finds the textbox value on a worksheet and using Offset it inserts "yes" in the next cell.

View 6 Replies View Related

Run-time Error '91' When 'On Error Goto' And Cells.find

Oct 8, 2008

I have written a Excel (2003) that searches a worksheet for a string in any cell. If the string is not found, it uses the 'On Error GoTo' command to jump to a given label. It works fine on the first string not found. When it searches for the next non-existent string, it fails with:

'Run-time error '91':
Object variable or With block variable not set'

Do I have to clear a buffer after each cells.find search?

My

View 7 Replies View Related

Locating A Value On A Table

May 14, 2009

I've got a table similar to the below (but with a few more columns & rows). I need 2 look at 2 cells one contains a $value (say $75,000) the other contains a code (say C). I need it to return the correct value - in this example 3.00%.

This is going to be too messy to use a vlookup, I'm sure there is something better. Is this where you use Match or Index ... both of which I don't understand how they work. Or something else ?

ABCD
$ 1 $ 50,000 1.00%1.50%2.00%2.50%
$ 50,001 $ 100,000 2.00%2.50%3.00%3.50%
$ 100,001 $ 250,000 3.00%3.50%4.00%4.50%


A B C D
$1 $50,000 1.00% 1.50% 2.00% 2.50%
$50,001 $100,000 2.00% 2.50% 3.00% 3.50%
$100,001 $250,000 3.00% 3.50% 4.00% 4.50%

View 9 Replies View Related

Locating Closest Value In Range

Jul 6, 2008

I have a range of date values that span B1:BA1 and I need to find the next date value greater than TODAY() and return the column number.

View 14 Replies View Related

Locating Data In A Table

Oct 24, 2008

How can I locate 1000 or the closest number from column 5, and all the data to the left of it? I have tried all the commands I could find, and nothing has worked for me.

This is the data I want to pull from the table.

1.463149.6271.0440.985999.87

View 11 Replies View Related

Locating Duplicates Within Spreadsheet

Sep 15, 2012

I need a macro that identifies duplicates within a spreadsheet. Unfortunately, the utility provided by Microsoft is not adequate because the text strings that are potential duplicates are nestled inside other text.

Fortunately, however, there is a unique text string that will locate the duplicated data. Below are two examples:

Plus -- Zero Box ==> Zero Box Medium ID=7288 (submittedby Anna Johansson)
Basic -- Zero Box ==> Resolve Medium ID=6397 (submittedby Kazy Suzuki)

The data that needs to be identified as potentially duplicated is the four digit number (i.e. 7288 and 6397). You will notice that they are preceded by “ID=”.

The spreadsheet has over 26,000 rows of data and 1700 plus IDs. The characters ID= proceeds the four digit number in all cases.

I simply need a macro that will provide a list of the four digit numbers that are duplicates. This will allow me to easily locate and manually delete any surrounding, unwanted data from the spreadsheet.

The data that the macro needs to search is contained in and restricted to Column C.

View 2 Replies View Related

Locating Cell Number

Jan 12, 2010

Take a look at these columns below;

.00 810.00 .00 1,729.00 .00 1,594.00 .00 1,599.00 .00 498.00 498.00 .00 .00 1,852.00 .00 454.00 .00 50.00
I want to find the cell reference number of any value of column A (which is greater than 0) in column B. I could only manage to find values with my formula i.e.

=IF(A1>0,VLOOKUP(A1,$B$1:$B$9,1,0),0)

View 9 Replies View Related

CountIf - Locating Cell Location

Apr 2, 2014

I have a column full of data like the below with relevant data on the same row.

I wish to locate the cells which have a specific section most importantly without the "cartridge only" so for example with the below

Word Academy (Nintendo DS)
Word Academy (Nintendo DS) (Cartridge Only)

This would show 2 given there are two with the specific text "Word Academy (Nintendo DS)" there will always be a cell without the (Cartridge Only) part so for this the formula =COUNTIF(D:D,"*" & D1 & "*") seems to do the job to simply count the cells with that in however I do not wish to do this.

What I need to do is locate the cells that have this in but match them together in a large sheet so basically I somehow need to be able to locate the two corresponding cells which both have one of the cells values of "Word Academy (Nintendo DS)"

The cells have data in the row which I need to tie together to create a total value.

For example

Title Qty
Word Academy (Nintendo DS) 5
Word Academy (Nintendo DS) (Cartridge Only)6

I need to locate the all the cells with "Word Academy (Nintendo DS)" in which would mean just the two cells "Word Academy (Nintendo DS)" + "Word Academy (Nintendo DS) (Cartridge Only)" in the above instance but I need it to then see the cell which has that in its title and add the quantity of the two together leaving me with the below

Title Qty Actual Qty
Word Academy (Nintendo DS) 5 11
Word Academy (Nintendo DS) (Cartridge Only)6 11

Which is basically just adding together the quantity shown on the spreadsheet in the rows with the containing text "Word Academy (Nintendo DS)" and as "Word Academy (Nintendo DS) (Cartridge Only)"

On the attached spreadsheet Column L is an example of the result I would be desire, I have put a basic =sum formula in to just represent the value it should be showing.

View 4 Replies View Related

Locating Home My Documents Folder

Mar 10, 2007

On the computers in my office they have a My Documents folder that is in the directory C:Data. There is also a My Documents folder in the usual windows location C:Documents and Settings etc. Is there a function that will give me the path of the folder that is on the desktop? The macro will be run on computers with the folder in different locations which is why I need to look it up.

View 5 Replies View Related

Locating Largest Numbers In Separate Sets

May 6, 2009

1 35
2 37
3 39
4 22
5 25
6 27
7 28
8 23
9 25

I have the above table. What I want excel to do is to grab the largest number in each set of numbers from the second column and return the corresponding number in the first column. So basically, excel would return a 3, 7, and 9 in cells C1, C2, and C3.

View 8 Replies View Related

Extracting Data Via Locating Row And Column Number

Apr 27, 2012

Sheet1
DEPARTMENTLOCATION POSITION TITLEPOSITION NUMBERCODEKXNJCEO34500A3100KXNJCEO34501A3200DXDLMGR42001A5600DXDLMGR42002A5700NXNLCHIEF23001A1200
Data Range: A1:E6

Sheet2
DEPARTMENTPOSITION NUMBERLOCATION POSITION TITLECODEKX34500ANJCEO3100KX34501ANJCEO9100DX42001ADLMGR5600DX42002ADLMGR5700NX23001ANLCHIEF1200
Data Range: A1:E6

What I need is a formula (Not a VBA), is to reconcile both sheet2 and sheet1 ensure that the codes appearing for each position number in sheet1 gets updated based on the codes for each position number appearing in sheet2. So, for instance, the code for pos #34501A should be changed from 3200 to 9100 in sheet1.

The only issue with sheet2, though, is that the column number for position number could be different each time new data gets copied into sheet2 (thought the header information stays the same). I know that it can be done via Vlookup if the place of the column doesn't change each time, but I just

How to locate the correct column and row in a range of cells to search and then extract information based on certain conditions.

View 7 Replies View Related

Formula For Locating Last Cell Above That Contains A Number And Adding 1

Feb 14, 2013

Im trying to develop a formula that sequentially numbers in column a depending on if there is a value in column B

We have documents at work that have alot of text with random spacing between that needs a sequential reference number so would like the formula to be able to look at the value in column b and if its not blank add a number . I would like this number to be the previous cell above + 1

the formula ive started looks something like =if(B10""), ???????,""

can not get excel to reference cell the last cell above with data.

View 3 Replies View Related

Locating Data From Closed Worksheets In Multiple Directories

Jan 28, 2010

I would like to create a macro which finds data from multiple worksheets and collates them in my Master Worksheet.

I am competent with a lot of functions with Excel, however I have never used Macro's before. I have a little bit of VB knowledge, but only the very basics. I will attempt to explain my situation as clearly as I can.

Please note in your response that I am not familiar with a lot of the programming jargon. I also do not know how to actually create (or is it record?) a macro.

Finally, before I dive into it, I would *prefer* not to have to add code to the closed worksheets, but I can do this if there is no other way!.......

View 14 Replies View Related

Locating Certain Row Of Data Containing Keywords And Displaying Portion In Another Workbook

Aug 21, 2013

I have a workbook with a master data list including member names, member locations, member phone numbers, and various items checked out or on loan to members. I then have multiple sheets breaking down the data for quick reference. So for example Name, Member #, Location, Phone, Item A, Item B, Item C, Item D etc... I need to be able to have all the Members that are in certain cities displayed in it's own worksheet. I have played with the aggregate function, if and functions,... and I am dying. This is for a motorcycle club to keep track of who has ordered what, how much they owe, how much they've spent etc.

View 1 Replies View Related

Locating Next Similar Condition In A Range And Performing Calculations

May 11, 2007

I have a set of data with names in col A, Currency in col B, Amount in Col C. I want to convert all the amounts in NON-USD based on exchange rate I input daily into column D.

How do i search down the row for the next name that is denominated in GBP / YEN etc and keep converting until I dont find any more other currencies in it. I tried to improvise on the finding nth but couldnt get anything out of it. Have attached a spreadsheet.

View 9 Replies View Related

Excel 2010 :: ADO Recordset Query Quandary Locating Duplicates

Mar 13, 2013

I am having trouble setting up a query for a recordset that will list duplicates for an automated process to clean up. I am using Excel 2010 with Microsoft ActiveX Data Objects Recordset 6.0 Library and Microsoft ActiveX Data Objects 6.1 Library as references.

So far, I have chopped the query down to it's most basic elements and reassembled until it broke. Necessary pieces work well, but when I combine them, I get nowhere.

Here is the working simple query to retrieve a single row:

Code:
dupeSQL = "SELECT PSID FROM [Obstructed$] "

Here is the working single query to retrieve a count:

Code:
dupeSQL = "SELECT COUNT(PSID) As '" & "CountPSID" & "' " _
& "FROM [Obstructed$] "

When combined, I cannot figure out why it won't work:

Code:
dupeSQL = "SELECT [PSID], COUNT(PSID) As '" & "CountPSID" & "' " _
& "FROM [Obstructed$] "

Here is what I am trying to get to:

Code:
dupeSQL = "SELECT [PSID], COUNT(PSID) As '" & "CountPSID" & "' " _
& "FROM [Obstructed$] " _
& "WHERE COUNT(PSID) > 1 " _
& "GROUP BY PSID"

I can even work without the GROUP BY. I have also played with the HAVING clause to try and accommodate the [PSID] field, but have gotten nowhere.

View 1 Replies View Related







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