View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Patrick C. Simonds Patrick C. Simonds is offline
external usenet poster
 
Posts: 343
Default Run code from within a UserForm

What I have is a DialogBox (called DataInput) with a large number of
TextBoxes and when I exit each one of the text boxes I wanted to run the
code below. So in an effort to reduce the number of lines of code, I had
hoped I could have just entered one line:

Module2.DisplayPay

But I get an object required error.


Sub DisplayPay()

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

TextBox611.Value = rng(1, 99)
TextBox612.Value = rng(1, 104)
TextBox613.Value = rng(1, 109)
TextBox614.Value = rng(1, 114)
TextBox615.Value = rng(1, 119)

End Sub