I attached the file here and I only want in UF frmCodeItem, CbSubCategory to mention the table instead the column and also frmCode same
Private Sub CbSubCategory_Change()
Dim sutr, sr As Long
Dim deg1, deg2 As String
LB_01.RowSource = Empty
If Me.comDepartment.Value = Data.Range("AE7") Then
'HERE Want to replace row number and column number with column table name like (T_Food[Item Name])
For sut = 7 To Data.Cells(Rows.Count, 2).End(xlUp).Row
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
deg1 = Data.Range("H" & sut) 'here also replacing the latter H to (T_Food[Dep])
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
deg2 = CbSubCategory.Value
'TextBox1.Text = duzenle(TextBox1.Text)
If UCase(deg1) Like UCase(deg2) & "*" Then
LB_01.AddItem
LB_01.List(s, 0) = Data.Range("A" & sut) 'Here also
LB_01.List(s, 1) = Data.Range("B" & sut)
LB_01.List(s, 2) = Data.Range("C" & sut)
LB_01.List(s, 3) = VBA.Format(Data.Range("D" & sut), "$#,##0.00")
LB_01.List(s, 4) = VBA.Format(Data.Range("E" & sut), "$#,##0.00")
LB_01.List(s, 5) = Data.Range("F" & sut)
LB_01.List(s, 6) = ""
LB_01.List(s, 7) = Data.Range("H" & sut)
s = s + 1
End If
Next
End If