ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application.Match Ignore Character (https://www.excelbanter.com/excel-programming/446068-application-match-ignore-character.html)

meljunk

Application.Match Ignore Character
 
Hi all,
I want to run a Match however the values in my Spreadsheet may contain a "." that I want to ignore e.g.

Search Text= "123456"
Value in Spreadsheet = "123.45.6"

atRow = Application.Match("123456", ws.Range("A1:A1000"), 0)

So basically if there is a "." in the rows I'm searching I want to ignore them. I do not want to alter the Spreadsheet though.

Thanking you in advance.

meljunk

Dim s As String
Dim lRow As Long

s = "123456"
lRow = Application.Match(s, Application.Substitute(Range("A1:A1000"), ".", ""), 0)

Quote:

Originally Posted by meljunk (Post 1601807)
Hi all,
I want to run a Match however the values in my Spreadsheet may contain a "." that I want to ignore e.g.

Search Text= "123456"
Value in Spreadsheet = "123.45.6"

atRow = Application.Match("123456", ws.Range("A1:A1000"), 0)

So basically if there is a "." in the rows I'm searching I want to ignore them. I do not want to alter the Spreadsheet though.

Thanking you in advance.



All times are GMT +1. The time now is 05:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com