choose 3 numbers from an account#

Smithgall

Board Regular
Joined
May 24, 2006
Messages
68
i have a list of 10 didgit account numbers. i want to highlight in someway could be as simple as using conditional fomatting to bold the text of all the account numbers that have my assigned range.

Meaning that i am assigned account 150-180. but the way i see if its my account is based on the 7th-9th position.
ex. 9658741671 would be assigned to me because the 167

how do i recognize that part of the number(i guess its actually labled as text) to then use formatting to bold the entire number?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Maybe in conditonal formatting try:

=and((mid(A1,7,3)+0)>=150,(mid(A1,7,3)+0)<=180)

Hope that helps.
 
Upvote 0
In VBA, try this code. It assumes your account numbers are in column "A" and that there is no header, adjust accordingly.

Code:
Sub MyAccounts()
Range("B:B").Insert Shift:=xlToRight
Dim lastRow As Integer
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
With Range("B1:B" & lastRow)
.Formula = "=MID(RC[-1],7,3)"
End With
Range("B:B").Value = Range("B:B").Value

    Dim c As Range
        For Each c In Range([B1], Cells(Rows.Count, "B").End(xlUp))
            If c.Value > 149 And c.Value < 181 Then c.Offset(, -1).Font.Bold = True
        Next c
Range("B:B").Delete
End Sub
 
Upvote 0
Maybe...

=LOOKUP(MID(A1,7,3)+0,{0,150,181},{"N","Y","N"})

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,214,403
Messages
6,119,309
Members
448,886
Latest member
GBCTeacher

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