Can Wildcard Search Asterisk Be Tuned Off When Using VBA Code?

Dec 26, 2012

I am trying to run a routine in VBA that will Search for a Part-No. that normally contains asterisks. It is giving me bad positive Search results due to the coding looking at the (*) asterisk's as a wildcard character.

The following Part-No.'s are located in cells (C11:C16):
9L3Z*17757*BCP
6C3Z*16138*AACP
AE5Z*16138*B
AE5Z*17E811*CF
AE5Z*17E811*F
AE5Z*17E810*F

Part-No. to be Searched for:
AE5Z*17E811*F

When the below code is run, the incorrect Part-No. 'AE5Z*17E811*CF' is found in cell (C14) rather than the correct Part-No. found in Cell (C15).

Code:
'The following 2 lines are defaulted for ease of coding
pNumb = "AE5Z*17E811*F"
Range("C11", "C16").Select

[Code] ......

View 5 Replies


ADVERTISEMENT

Can Use Asterisk Wildcard To Save File In Multiple PATH?

May 30, 2014

Can I use the asterisk (*) wildcard to save the file in multiple PATH as long as it the file is in the master drive C:

Ex: the file now is in "C:Public" then can I use "C:Public*" so user can save file at their desire sub-folder such as "C:PublicHenry" as long as it has to be in drive C

View 6 Replies View Related

Search For Special Character * (Asterisk)

Jan 2, 2008

I'm working again with a large Inventory Database dump into a workbook and in the past the company appended the * character to designate an updated price on an item(column C). Its rocking my world to sort through things with this character as you can tell. I'm trying to find rows that column C has a * in, cut, and paste them into another sheet called "Updated". I would even accept just how I'd do a simple "find/replace all" on that character and then I can just update my macro and be on my way Anyway this is the macro thus far and as you can see it would just cut all rows and paste them to "Updated".

Sub Updated()
With Worksheets(1).Columns("C")
Set c = .Find("*", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.EntireRow.Cut Destination:=Worksheets("Updated"). Range("A" & Worksheets("Updated").Range("A65536").End(xlUp).Row + 1)
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub

View 2 Replies View Related

Search Using Wildcard In Macro

Dec 29, 2011

I have a spreadsheet where there are lines of different Wage Types but only certain combinations are needed. For example I have Pay Area 1234 which needs all wage types except those beginning with a 9.

To do this I have set up Sheet1 to look like this:

12341
12342
12343
12344
12345
12346
12347
12348

and not 12349 as I do not require this type.

The problem here is I need to add a wildcard to the end of these so it finds anything that starts with 12341 etc.

Sheet1 contains the personal details of employees and I have concatenated the Payroll Area and Wage type in column D.

Code:

Sub deleterows()
Application.ScreenUpdating = False
Set MySheet = Sheets("data")
LR = MySheet.Cells(Rows.Count, "D").End(xlUp).Row
For i = LR To 2 Step -1

[Code]...

View 9 Replies View Related

Using Wildcard With Search And Replace

Jan 21, 2009

I have numerous formulas that use a macro with an indirect cell reference, for example:
INDIRECT(macro(A21))

I am moving these formulas to a different workbook and I need them to still refer to items in the old sheet. I accomplish this by using this formula:

INDIRECT(CONCATENATE("OtherSheet.xls!",macro(A21)))
This works. However, I need to do a global search and replace for all of these formulas without deleting my indirect cell reference. I could replace
macro
with
CONCATENATE("OtherSheet.xls!",macro
but that would leave me short a ).
Is there a way to use a wildcard to accomplish this? It does not seem that replace
macro(*)
with
CONCATENATE("OtherSheet.xls!",macro(*))

View 9 Replies View Related

Vlookup With Wildcard Search

Oct 28, 2008

picture this.

Cell A1 = xyz3
Cell B1 = 5
Cell C1 = xyz3-hgfe-56f

I need to do a vlookup on C1 in range A1:B1 that will return B1 if C1 contains the string in A1. I've tried using the TRUE variable in the vlookup formula which does not require an exact match. This works for about 80% of my data but is not 100% accurate. Of course I've got a long list of data ... not just the 3 cells.

View 4 Replies View Related

Search For The Character- Not Wildcard

Nov 20, 2006

I need to get rid of the questions marks in the text on my sheet, but am unable to get my VBA code to search for an actual question mark and not the wildcard. I'm using the replace function as follows:

wsReport. Cells = wsReport.Cells.Replace("?", "")

1. What's the trick to searching for wildcard characters?

2. Is there a slicker way to do this?

View 3 Replies View Related

Wildcard Search - Titles To Appear In Another Cell

Dec 10, 2013

I have a list of titles that I would like to see if these titles appears in another cell.

Here is the example:
A1
Manager
Assistant Manager
Manager, II
VP
Vice President, Sales
Assistant
Associate

I would like to see if it appear in this cell, regardless where it is the exact text match
B1
Manager, Assistant, VP, Sales

So the result will be like: Screenshot_1.png

View 4 Replies View Related

Search On Multiple Entries Using Wildcard

Jul 29, 2014

I'm trying to perform a search of over 15,000 entries using a wildcard. Sheet1 is a list of streets in the county where I live, and I would like to be able to type a part of the name that will return every instance of that name appearing.

I found a code which i have tried to adapt, but it is not working.

[Code] ....

The item being searched will be entered into TextBox1, and I'm guessing that the error I am receiving is in the .AutoFilter Field:=1, Criteria1:=TextBox1"*" line of code. This is the original sample I found onlne:

[Code] .....

where they were only looking for the letters "GB".

View 14 Replies View Related

Formula For Wildcard Search Only If All Critera Is Meet

Apr 30, 2009

i am having some difficulty modifing some existing code which is this: It will count all entries from G14 to G217 if *Ost* is in E14:E217

View 3 Replies View Related

VLookup In Array Search With Wildcard Characters

Jul 10, 2012

I have a sheet with Names in it. I need to look those names up and find which org they belong to. The problem is the the names have many characters after them, and many names belong to a few orgs, with a the rest belonging to many orgs. (See below)

I have been trying to get a Vlookup to work, but since it can't go left, it won't look up the orgs that don't own at least three names. And I can't get the search to work on the names.

Names:
WSGHG1-8410YFH

WSSMXG-8401B8T

NBSMXG-0310V6R

NBXG-0310V6V

[code]....

View 4 Replies View Related

Search For Pattern Of Numbers / Letters And Wildcard

Dec 19, 2012

I would like to search for a certain pattern that appears in a cell. For example, I have certain cells that begin with a 7 digit project code (Ex: "1234567 - Project Red"). I was planning to use an IF inside a FOR loop and then do an action when I find the cell with the pattern. I thought I remember it being something like Format(########*) so that I have the wildcard on the end since there is more than just the numbers. how to make other patterns work such as Number-Letter-Number or Capital-Lowercase-Capital

View 3 Replies View Related

Wildcard Info In Output Of Search Formula?

Jul 29, 2014

I have a formula in column J that is the following:

=IF(I541="",IF(ISNUMBER(SEARCH(LEFT(G541,4)&"*"&RIGHT(G541,4),H541)),G541,""),"")

See screenshot:

I need to replace "G542" in the formula above. For example, in cell J541 shown above, I need it to output "1996-1999|2000-2001" instead of "1996-2001" I need the output to include LEFT(G541,4)&"*"&RIGHT(G541,4)

View 2 Replies View Related

Search Text Cell For Wildcard Match

Feb 27, 2007

I am looking for a way, to search a cell that has a no more than 4 words sperated by a space, and if a match display it.

I had something like this:

IF(Search=LocationList,"true","False"

So the Locationlist is a list of locations that is brought from another sheet with this:

=Addresses!A3&" "&Addresses!B3

and i need to search the cells with in LocationList (about 4000 cells) for a match... is this possbile ?

View 9 Replies View Related

Retrieving Nth Results From Index Match Using Wildcard Search Term

Jun 9, 2014

I am building somewhat of a rudimentary search engine that looks for a name, address or unique identifier, using an Index Match formula that searches with a wild card:

=INDEX(Name,MATCH("*"&F3&"*",Name,0))

"Name": is the defined name for column C on a separate sheet.
F3: is "search field"

The current formula (above), only returns the first match. The source data is only 927 lines so not overly large. I would like to have an additional page that will show the potential results from the wildcard search via a formula. Therefore needing results; 2, 3, 4, 5 etc. from the Index Match. I have searched high and low for solutions but I have found none in regards to retrieving multiple results from a wildcard search, only on a specific term.

View 3 Replies View Related

Add Nested ISNA & VLOOKUP With Wildcard Via Macro Code

Aug 23, 2008

I have the following vlookup working exactly as I want it to in excel: =IF(ISNA(VLOOKUP(LEFT(C2,10)& "*", NAME,2,FALSE)),"",(VLOOKUP(LEFT(C2,10)& "*",NAME,2,FALSE))) -NAME is a defined section on another worksheet

The problem I have is when I come to use this within a vba macro I'm writing the wildcard section automatically gets spaces added so it goes from "*" to " * " and excel doesn't like it! The code I'm using to write it into the cell is simply:

ActiveCell.FormulaR1C1 = _
"=IF(ISNA(VLOOKUP(LEFT(c2,10)& " * ",NAME,2,FALSE)),"",(VLOOKUP(LEFT(c2,10)& " * ",NAME,2,FALSE)))"

how to stop the spaces being added?

View 2 Replies View Related

Excel 2010 :: VBA Code That Handles Several Specific Parameters Or Wildcard Passed To Access

Jul 17, 2013

I would like to develop a user-friendly Excel 2010 spreadsheet that would allow the user to enter from 1 to 10 (i just picked this number at random just to have an upper limit) employee numbers in cells A1-A10 and "click" on the VBA Code button that would invoke an Access Query and in the process return all the applicable data gathered from the query back into the Excel Spreadsheet. Believe it or not, I can do all this mentioned so far. BUT what i cant do is my second option for the user which is allow them to pull ALL of the employees back into the spreadsheet using the same query.

In summary, using Excel as a frontend dashboard, I know how to get a specific number of employees' information from a query and I know how to get all employees' information from a query but I dont know how to get either/or. In other words, I could do this with two queries and two "VBA-Code" buttons but I would like to do it with one query and one button.

View 1 Replies View Related

Find And Replace Asterisk

Oct 25, 2013

How does one use the find and replace function in Excel to replace an asterisk? "*"

View 2 Replies View Related

SUMPRODUCT Contains Text, Using Asterisk

Nov 9, 2009

Let's say I have two columns: Homeless (column A) & Services (column B). Homeless responses can be either "Y" or "N". Service can be "a", "b", or "ab". Here is an example:

Homeless Service
y a
y b
n a
y ab

I was hoping to use SUMPRODUCT to calculate clients who are homeless and receiving "a" service. I want to be able to calculate those receiving "a" service even if they are receiving "b" service, so I attempted to use asterisks like I have used prior with the COUNTIF function. Here is what I thought would work:
=SUMPRODUCT((A2:A5="y")*(B2:B5="*a*"))

And I expected it to return 2, but I found that I couldn't get the SUMPRODUCT to work with asterisks. I am able to get the results I want be creating a new column to sort the services into just those who are homeless and then using COUNTIF, but I'd rather come up with a more streamlined approach.

View 3 Replies View Related

Asterisk For Password Entry

Dec 1, 2006

I have an input box for the user to type in a pin number to identify themselves, I would like to make it so that what is seen in the input box is the * symbol as in most applications. I have sussed out how to do it with a text box in a form but if I use that it would mean a major rewrite of my code,

View 9 Replies View Related

Remove Asterisk From Cells

Sep 6, 2007

I have data in column "A" that contains an asterisk at the end of the cell value. The problem is, this asterisk can be any number of spaces away from the value that I want. remove this character from the cells? Data is copied from another program and the number of rows can be different from day to day.

View 5 Replies View Related

Color Cells Containing Asterisk

Jun 19, 2008

I attach picture.

I need to put * and in that field appear word from above and to change field color to one of three presented colors depend in which row * is inserted.

All other fields need to be empty and white, like on second picture.

I know that is little If...Then, but I don't have so much knowledge.

View 7 Replies View Related

How To Remove Text After The Second Instance Of An Asterisk?

Jun 18, 2009

I'm trying to convert variable length strings which are being copied from a display and loaded into an array.

I have it working fine for the majority of the data, which comes in looking like "*ABC@US" or "*AABC@US"

However, some of the data looks a bit different, particularly lacking the @ symbol. So what I end up with is

"*ABC US*ABC US*ABC US"

What I need to get to is just "ABC US" FYI the US part can be 1-5 characters.

SO... I need a way to truncate anything after the second instance of the asterisk. Haven't been able to get it to work using various trim, mid, len, left, right, etc functions.

View 9 Replies View Related

Saving A File To Asterisk Delimited?

Aug 30, 2013

I am trying to open up an asterisk delimited file then shrink the data, then after I want to save it back as an asterisk delimited text file. How would this be done in vba, as well as manually?

View 2 Replies View Related

Change Color Of One Cell When Asterisk Entered In Another

May 15, 2013

I need to have the color of cell A2 change when I enter an asterisk in cell A1 to denote a critical dimension on an inspection form.

I used conditional formatting to change cell A1 orange when an asterisk is entered. Is there a way to tell cell A2 to look and see if there is an asterisk in A1 and if so change it's color?

View 4 Replies View Related

Conditional Formatting On Two Columns To Ignore Asterisk

Oct 28, 2011

I'd like to compare two columns of data and highlight where a value doesn't occurr in both columns. The problem I have is that one of the columns uses * around the text to ensure it catches all variations of the value.

I have the following formula which would work if the data was exactly the same.

=COUNTIF(lst2,value)=0

However, these *'s are meaning it never works.

Is there a way to make it so that if the values with the *'s are not found in the 1st column of data, conditional formatting is activated?

View 4 Replies View Related

Add Asterisk Symbol As Text At End Of Cell With Formula?

Nov 29, 2011

I am trying to add a * at the end of a value in a cell, used to signify a note at the bottom of the page. However, as the cell contains a formula, excel thinks I am adding a multiplication sign instead.

Is there anyway to place a * at the end of the value, to show up in the cell as text? I would prefer not to have to paste the value of the cell and then add the *...

View 3 Replies View Related

Find And Replace Numeric Amounts With Asterisk

Oct 23, 2012

I have an ad hoc txt file that I import into Excel and use text to columns. The problem is some of the amounts have an asterisk in it such as: 10,412 *

I tried to use the find and replace, but the "*" is considered a wildcard and instead of changing the field to just 10,412, it deletes the entire amount.

Is there a macro that I can use to get around this? The amounts are listed in column G & H

View 4 Replies View Related

If Cell Doesn't Start With Asterisk Delete Row

Jun 20, 2007

Sub DeleteRowsBasedOnCriteria()
'Assumes the list has a heading.
Dim cl As Range
For Each cl In Range("A6", Range("A65536").End(xlUp))
If cl.Value <> "=~*" Then
cl.EntireRow.Delete
End If
Next cl
End Sub

but it is deleting every row, I am not sure what is wrong?
starting in cell A6
if cell does not start with *, then
delete entire row,
next cell

that is the logic im seeing...ive tried a few o ther combinations like "~*" etc...

View 9 Replies View Related

Saving A Worksheet As A Asterisk Delimited Text File?

Sep 19, 2013

I am trying to save a worksheet as a txt file. The worksheet has a range of data with a variable amount of rows in column A only. It generally will look like:

A*B*C
A*B*C*D*E*F*G*H*I*J
A*B*C*D*E*F*G*H*I*J
A*B*C*D*E*F*G*H*I*J

where each row of data is in a single cell.Whenever I save it, however, it adds extra tab deliminations in each row after the data, and it adds rows with no data (sometimes just 1, sometimes many).

I am positive that no cells in columns B-n have data in them (even just a space) and no rows after the last intended have data.

Why are these extra rows and columns being inserted? How can I save a txt file that literally has no other spaces or rows or deliminations other than what's intended?

View 2 Replies View Related







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