I have TextBox which contain number over 15 digits. When I copy the textbox value into excel cell, starting from digit 15th excel will change it zero number. This is Excel's way if cell format as number. I change the cell format from number to text, and input manually the number, and its work.
But when I use Index, Match function on macros, it doesn't work and I get
Run-time error 1004 "Unable to get match property of the WorksheetFunction class
This is the code I use for index, match function
Dim b As Double
b = TxtCvNo.Text
With Application.WorksheetFunction
If .CountIf(Sheet2.Range("G:G"), b) = 1 Then
TxtCVId.Text = .Index(Sheet2.Range("A:A"), .Match((b), Sheet2.Range("G:G"), 0))
Else
b is the TextBox value.
Match function doesn't recognize b as this value were input as 'text' in Excel cell
How can I copy the textbox value into cell as text to avoid digit 15th, 16th and so on change to zero. How can I fix the index, match function after it.
this screen shot of my Data. I use Index and Match to identify whether the coupon 1,2,3 has been use as coupon ref, and then tell me the ID Respondent use that Coupon.
screen shot data