Hi.
Below is some code ive got set in a user form. In a module i have some code to find an entry in column c. When it finds that value, that cell becomes the active cell. The code below then uses the offset function to load the user form data into the the data base. What i need to do is to display on this user form the value of column "L" in the text box I have named "txtrecol" could anyone suggest ways of changing this code so that its possible to see the entry from the userform? I can allow column "L" to become the active cell though. Column "C" has to remain the active cell.
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdclearform_Click()
Call UserForm_initialize
End Sub
Private Sub cmdok_Click()
ActiveWorkbook.Sheets("COMPLAINTS").Activate
ActiveCell.Offset(0, 11) = recondate.Value
ActiveCell.Offset(0, 12) = txttime.Value
ActiveCell.Offset(0, 13) = txtdateonsite.Value
ActiveCell.Offset(0, 14) = cboccar.Value
ActiveCell.Offset(0, 15) = txtmiles.Value
ActiveCell.Offset(0, 16) = txttravel.Value
ActiveCell.Offset(0, 17) = txtnotes.Value
Unload Me
End Sub
Private Sub UserForm_initialize()
ActiveWorkbook.Sheets("COMPLAINTS").Activate
Me.txtjobnum = ActiveCell.Value
recondate.Value = Format(Date, "dd/mm/yy")
txttime.Value = Time
txtdateonsite.Value = ""
With cboccar
.AddItem "Yes"
.AddItem "No"
End With
txtmiles.Value = ""
txttravel.Value = ""
txtnotes.Value = ""
End Sub
Below is some code ive got set in a user form. In a module i have some code to find an entry in column c. When it finds that value, that cell becomes the active cell. The code below then uses the offset function to load the user form data into the the data base. What i need to do is to display on this user form the value of column "L" in the text box I have named "txtrecol" could anyone suggest ways of changing this code so that its possible to see the entry from the userform? I can allow column "L" to become the active cell though. Column "C" has to remain the active cell.
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdclearform_Click()
Call UserForm_initialize
End Sub
Private Sub cmdok_Click()
ActiveWorkbook.Sheets("COMPLAINTS").Activate
ActiveCell.Offset(0, 11) = recondate.Value
ActiveCell.Offset(0, 12) = txttime.Value
ActiveCell.Offset(0, 13) = txtdateonsite.Value
ActiveCell.Offset(0, 14) = cboccar.Value
ActiveCell.Offset(0, 15) = txtmiles.Value
ActiveCell.Offset(0, 16) = txttravel.Value
ActiveCell.Offset(0, 17) = txtnotes.Value
Unload Me
End Sub
Private Sub UserForm_initialize()
ActiveWorkbook.Sheets("COMPLAINTS").Activate
Me.txtjobnum = ActiveCell.Value
recondate.Value = Format(Date, "dd/mm/yy")
txttime.Value = Time
txtdateonsite.Value = ""
With cboccar
.AddItem "Yes"
.AddItem "No"
End With
txtmiles.Value = ""
txttravel.Value = ""
txtnotes.Value = ""
End Sub