Hi Jeff

I tried your code, and it resulted in the same errors. After another search on the internet, I came up with a solution that worked. I changed "L" to "CLng(L)" in the Match function line.

I have also made 2 other changes (refer the Dim and Set R2 lines)

Here is the final code:

Private Sub Test()

   Dim t As Variant
   Dim TypeTable As Range
   Dim AccNo As Range
   
   Dim R1 As Range
   Dim R2 As String  'Changed
   Dim L As Variant
   Dim A As Range
   Dim M As Long
   
   Set R1 = Sheets("ChartOfAccounts").Range("TypeTable")
   R2 = Sheets("Journal").Range("C27").Value     'Changed
   L = Left(R2, 6)
   Set A = Sheets("ChartOfAccounts").Range("AccNo")
   M = Application.WorksheetFunction.Match(CLng(L), A, 0)   'Changed
   
   t = Application.WorksheetFunction.Index(R1, M, 1)
   
MsgBox ("Type = " & t)

End Sub
Thank you for your help.