Hi,
I have a userform (pasting mini sheet) how to modify the file that I can search from any of the fields, also right now keep saying data no found and then display the correct information can it modify to display "data no found" only if is true that the record doesn't exist.
here is the code:
Thank you,
I have a userform (pasting mini sheet) how to modify the file that I can search from any of the fields, also right now keep saying data no found and then display the correct information can it modify to display "data no found" only if is true that the record doesn't exist.
here is the code:
VBA Code:
Private Sub CommandButton1_Click()
Dim x, y As Long
x = Sheets("DIST CODE").Cells(Rows.Count, 1).End(xlUp).Row
With UserForm1
For y = 2 To x
If Sheets("DIST CODE").Cells(y, 1).Value = Val(.TextBox1.Value) Then
.TextBox1.Value = Sheets("DIST CODE").Cells(y, 1).Value
.TextBox2.Value = Sheets("DIST CODE").Cells(y, 2).Value
.TextBox3.Value = Sheets("DIST CODE").Cells(y, 3).Value
.TextBox4.Value = Sheets("DIST CODE").Cells(y, 4).Value
.TextBox5.Value = Sheets("DIST CODE").Cells(y, 5).Value
.TextBox6.Value = Sheets("DIST CODE").Cells(y, 6).Value
.TextBox7.Value = Sheets("DIST CODE").Cells(y, 7).Value
.TextBox8.Value = Sheets("DIST CODE").Cells(y, 8).Value
Exit Sub
Else
MsgBox " DATA NOT FOUND"
End If
Next y
End With
End Sub
NAVIGATA_DISTRIBUTION SETS-CODES.xlsm | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
2 | SAGEID | VENDOR | ACCOUNT # | LINE DESCRIPTION | G/L ACCOUNT | G/L DESCRIPTION | ORG UNIT | ANALYST | ||
3 | 100215 | ABC COMM. | 17786-28380,28620, 30862 | Fixed Data-Customer-Data Services-17786- | 602110-28-500-100 | Fixed Data - Customer - Data Services: C - TCOM - ONT | Navigata - Carrier Costing | MJT | ||
4 | 100109 | AFX COMMUNICATIONS | 80017 | LD - TOLL FREE OTHER SERVICES | 603202-28-500-100 | LD - TF - Other : C - TCOM - ON | Navigata - Carrier Costing | MJT | ||
5 | 100176 | AIRESPRING | 1352791 | LD - Toll DAL : C - TCOM - BC | 603220-28-500-100 | LD - Toll DAL : C - TCOM - ON | Navigata - Carrier Costing | MJT | ||
6 | 100072 | ANI NETWORKS | 100226-1001 | LD - Toll DAL : C - TCOM - BC | 603220-28-500-100 | LD - Toll DAL : C - TCOM - ON | Navigata - Carrier Costing | MJT | ||
7 | 100226 | ARIN | 100226 | LEGACY ANNUAL MAINTENANCE | 601420-28-500-100 | Internet - Other - General Internet Transit : C - TCOM - ON | Navigata - Carrier Costing | JM | ||
8 | 100125 | AT&T 831 | 831-000-5480-119,264,269 | Local&VOIP - Other - Services | 605130-28-500-100 | Local&VOIP - Other : C - TCOM - ON | Navigata - Carrier Costing | MJT | ||
9 | 100068 | BELL TOLL FREE | CB001945 | LD - TOLL FREE OTHER SERVICES | 603202-28-500-100 | LD - TF - Other : C - TCOM - ON | Navigata - Carrier Costing | MJT | ||
10 | 100356 | CCTS(COMMISSION FOR COMPLAINTS FOR TELECOM) | 611100-28-500-100 | Local&VOIP - Regulatory Charges C - TCOM - ON | Navigata - Carrier Costing | MJT | ||||
11 | 100120 | CITY OF NELSON | 8048 | HALF RACK COLOCATION RENTAL PER MJTREEMENT | 601432-28-500-100 | Network Sites Utilities: C - TCOM - ON | Navigata - Carrier Costing | MJT | ||
12 | 100313 | CLOUD (CTI) | 63015 | EMBEDDED INTEGRATION/ADMIN FEES- | 760050-28-550-100 | Software Licences C - NSE ON | Navigata - Carrier Costing | MJT | ||
13 | 100271 | COMWAVE | L00004 | Local&VOIP - Other - Services | 605130-28-500-10 | Local&VOIP - Other : C - TCOM - ON | Navigata - Carrier Costing | MJT | ||
14 | 100116 | COUNTRY COMM. | 100116 | LD - Toll DAL : C - TCOM - BC | 603220-28-500-100 | LD - Toll DAL : C - TCOM - ON | Navigata - Carrier Costing | MJT | ||
DIST CODE |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G6,G12:G14,G8:G10 | G6 | =VLOOKUP([@SAGEID],Table2,5) |
C9,C14 | C9 | =VLOOKUP([@SAGEID],Table2[[SAGE ID ]:[Org Unit ]],3) |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
A3:H52,A53:E53,G53:H53 | Expression | =COLUMN()=CELL("col") | text | NO |
A3:H52,A53:E53,G53:H53 | Expression | =CELL("row")=ROW() | text | NO |
Thank you,