Finding spaces

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
2,114
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
I'm using Find like so and all is working well
VBA Code:
Set Found = Range(rCol).Find(What:=TextBox1.Text, lookIn:=xlComments, Lookat:=xlPart)
Except where the text in Comments may have chr$160) in place of chr$(32)
This was used as a delimiter to identify parts1 and 2 in a string.
Can I modify find somehow so it will still find these instances.
textbox1 has no way of knowing.
 
Yes, what I have is probably ok... (Find "Ben" then "Hur" within the results). Slight pause be nice to avoid but it it can't be done...
Thanks for helping.
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
I know you said you tried it but this worked fine for me:

VBA Code:
strFind = Replace(TextBox1.Text, " ", "?")
Then use strFind in your What:=
 
Upvote 0
Not clear to me, but ChrW(160) should find no-break space.
 
Upvote 0
Yes, Alex "?" did work up to a point. Once found I vblf split the comment wanting to Filter just that row.
That ran into a similar problem because of the chr$(160).
And although I could get around that the delay was just a bit too long.
So I redesigned the underlying data and replaced 160 with 32.
 
Upvote 0
Are you happy with where you have finished up ? If not please give a couple of examples of the data, what your current code is doing, what you would like it to do.
 
Upvote 0

Forum statistics

Threads
1,225,231
Messages
6,183,742
Members
453,187
Latest member
SJord

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top