highlighting numbers in tens position

rzml

New Member
Joined
Dec 24, 2020
Messages
40
Office Version
  1. 2016
Platform
  1. Windows
Hi,
looking for a vba code that will highlight the numbers in a range of cells containing 3,4,8 or 9 in the Tens position.
Thanks for the help.
 
Actually, a slightly easier to follow formula, the position is set by the division part of the formula
ones (see note below)
Excel Formula:
=SEARCH(MOD(INT(M2/1),10),"3489")
tens
Excel Formula:
=SEARCH(MOD(INT(M2/10),10),"3489")
hundreds
Excel Formula:
=SEARCH(MOD(INT(M2/100),10),"3489")
Note that INT and the division part are not necessary for the ones formula but I've left them in so that it is easier to follow. This one could be changed to
Excel Formula:
=SEARCH(MOD(M2,1),"3489")
and it would still work the same.
Thanks you very much. Appreciate your help. Thanks again
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,216,101
Messages
6,128,843
Members
449,471
Latest member
lachbee

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