Hello All!
I have tried this solution before and it worked, but I cannot repeat the same task. I have a Database where I am supposed to look up information, and if not found add as a new row with new information. I use User forms and Macros, but the values seem not to correspond. I am new at this, so please explain clearly. The below code gives the right value in User Form, but gives the value BuggNr=0 for the Macro code. The reason why both macro and user form is why I am planning on doing several more tasks
PLS ADV
Thanks in before
/Thomas
UserForm
Private Sub CB_Hitta_Click()
buggNr = Int(Me.LB_BuggNr.Value)
MsgBox (buggNr)
Call HittaBugg
End Sub
Macro
Sub HittaBugg()
MsgBox (buggNr)
For i = 1 To Cells(1, 1).CurrentRegion.Rows.Count
If Cells(i, 1).Value = buggNr Then
rad = i
MsgBox (rad)
Exit Sub
End If
Next i
End Sub
Bookmarks