I'm using a form where there is 3 textboxes. One of them (textbox2) is containing a # I'd like to find in the spreadsheet (within column "E" in fact) which will give me the row I need to update. This number is an integer but can be large (up to than 1,000,000).
I thought that I would be able to record a macro using "Ctrl+F" but it doesn't record anything. I found on the web the ".find" function but it's not working since it always returns "nothing" even if the value I'm searching is in the column.
What is wrong with my find function?
Is there anything else wrong in my code?
Anybody can give me a link explaining clearly the ".find" function and its arguments or tell me a better way to achieve this?
Dim a As String
Dim b As String
Dim c As String
Dim d As Double
a = Userform1.TextBox1.Text 'Emplacement
b = Userform1.TextBox2.Text 'Code
c = Userform1.TextBox3.Text 'Quantité
d = CDbl(b)
Set m = .Find(d)
If Not m Is Nothing Then
ActiveCell = m.Address
ActiveCell.Offset(0, 3) = a
ActiveCell.Offset(0, 1) = b
ActiveCell.Offset(0, 1) = c
MsgBox ("Allo SAG")