# choose 3 numbers from an account#

#### Smithgall

##### Board Regular
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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

#### schielrn

##### Well-known Member
Maybe in conditonal formatting try:

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

Hope that helps.

#### jmthompson

##### Well-known Member
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``````

#### Domenic

##### MrExcel MVP
Maybe...

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

Hope this helps!

#### Smithgall

##### Board Regular
thanks for all your help. those worked perfectly.

Replies
9
Views
1K
Replies
6
Views
657
Replies
0
Views
891
Replies
0
Views
591
Replies
0
Views
3K

1,191,095
Messages
5,984,637
Members
439,898
Latest member
Zack0611

### 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.

### Which adblocker are you using?

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

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