I have this code

password = Application.WorksheetFunction.Index(rangC, Application.WorksheetFunction.Match(SN, rangB, 0))
where
SN = Textbox1.Value

Without 'SN' then it works fine, but because I want to index-match the value in Textbox1 I need to figure out how to use it.

I'm pretty sure the issue is something to do with the data variable type; i used Dim SN As Integer because its a number I want to use
But even with other variable types I'm finding errors like "Run-time error '1004': Unable to get the Match property of the WorksheetFunction class"