I have multiple userforms that have textboxes with the same name e.g.txtSalary. I have duplicated code in each userform and want to place code in a standard module. Example below. When I run the code I get a runtime error "Object Required". I guess that I have to point the code to the specific object somehow?

Cheers

Peter

In userform code

Private Sub txtSalary_Change()
RemDec
End Sub

In standard module code

Public Sub RemDec()
If txtSalary.Text = "." Then
txtSalary.Text = ""
End If
End Sub