Can VBA to check all the charaters including symbols if it matches range("A1").character.

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi,

Can VBA to check all the charaters including symbols to see if it matches range("A1").character/symbol.

Suppose i have "?" in A1, can i make the vba to try entering all the characters or symbols available in B1 and then see which one matches A1???

Or do i have to list symbols, characters available in one column and make it guess by trying different values in b1???


Thanks for helping!
Pedie
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Good morning Pedie.

Do you mean this.
Excel Workbook
ABC
1?aZBb/?zZYes
Sheet1
Excel 2010<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> test()<br>    Range("C1") = Clear<br>  <SPAN style="color:#00007F">If</SPAN> InStr(Range("B1"), Range("A1"))<SPAN style="color:#00007F">Then</SPAN><br>    Range("C1") = "Yes"<br>  <SPAN style="color:#00007F">Else</SPAN><br>    Range("C1") = "No"<br>  <SPAN style="color:#00007F">End</SPAN><SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN><SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#007F00">' Or This</SPAN><br><SPAN style="color:#00007F">Sub</SPAN> test2()<br>  Range("C1") = Clear<br>    Ans = IIf(InStr(Range("B1"), Range("A1")), "Yes", "No")<br>  Range("C1") = Ans<br><SPAN style="color:#00007F">End</SPAN><SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0
Brian, thank you so much. Sorry couldnt check back yesterday....was late so went to sleep...
I'm giving it a try:)
 
Upvote 0
Hi Pedie,
You could do this with a formula too if you wanted...
Code:
=IF(ISERROR(FIND(A1,B1)),"Nope","Yes")

Hope it helps.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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