• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to replace "," or "." from a value using VBA

ThrottleWorks

Excel Ninja
Hi,

I have two different worksheet in same file.
Both sheets has a column for name.

I need to find sheet 1 name in sheet 2
For example, sheet 1 has name such as 'Suzuki, motorcycles Ltd.'

Sheet 2 has name as 'Suzuki motorcycles'.
I need to find this names as contains, also I need to remove , and . from my string before doing a contains search.

I have a loop. This loop is based in the names in sheet 1.
I am trying to do contains search with this loop.

For each name in sheet 1
Find this name in sheet 2 using contains (xlpart)

At present, I have populated a helper column, replaced all , and . before doing search.

But I would like to know how do I to achieve this with VBA. I am trying to write something like

"Rng.Offset(0, 3).Replace What:=".", Replacement:="", LookAt:=xlPart"
In my loop. If RNG value contains , or . in string then replace those values from that string.

In my loop, I want to write something like, find name from sheet 1 in sheet 2 as contains. But before finding the name remove , or . from the string.


How do I do this, can anyone please help me in this.
 
Hi !​
For example, sheet 1 has name such as 'Suzuki, motorcycles Ltd.'

Sheet 2 has name as 'Suzuki motorcycles'.
I need to find this names as contains, also I need to remove , and . from my string before doing a contains search.

I have a loop. This loop is based in the names in sheet 1.
Within a loop, no need to replace anything but just use Like operator !

If Range.Value Like "Suzuki*" Then

Just see this operator in VBA help !
 
Back
Top