I have a database in excel. Each row contains a unique number in column A. Column A is not not in any numeric order. I have a userform which has a text box (textbox1) in which I need to be able to type a number and then press a button (CommandButton9) to find the row number which that number is in.
The code works if I put text in the column that I am searching and search for the text, but it doesnt work when I look for numbers. The code is;
Dim x As Long
x = Application.WorksheetFunction.Match(TextBox1.Text, Range("a1:a1048576"), 0)
Range("a1").Offset(x - 1, 0).Select
When I try to use this code to find a number it does not work and I get a run time 1004 error - Unable to get the match property of the worksheetfunction class.
Please help!
Thanks
The code works if I put text in the column that I am searching and search for the text, but it doesnt work when I look for numbers. The code is;
Dim x As Long
x = Application.WorksheetFunction.Match(TextBox1.Text, Range("a1:a1048576"), 0)
Range("a1").Offset(x - 1, 0).Select
When I try to use this code to find a number it does not work and I get a run time 1004 error - Unable to get the match property of the worksheetfunction class.
Please help!
Thanks
Last edited: