Just need a better way to input 112 textboxes from column D - DN
instead of using this below for 112 textboxes
is there a way to use a shortcut like below
instead of using this below for 112 textboxes
VBA Code:
Cells(Rg.Row, "D") = TextBox3
Cells(Rg.Row, "F") = TextBox4
Cells(Rg.Row, "E") = TextBox5
Cells(Rg.Row, "G") = TextBox6
VBA Code:
Private Sub CommandButton1_Click()
Dim EmpID$, dDate$, Mth$, Yr$, Rg, Dd As Range, EmpCells&, i&, x&, Emp1Name As String, Emp2Name As String
EmpID = TextBox1.Value
If TextBox1.Value = "" Or TextBox2.Value = "" Then
MsgBox "PLEASE ENTER THE EMPLOYEE NUMBER AND EFFECTIVE DATE", vbExclamation: Exit Sub
End If
If Not IsNumeric(EmpID) Then
MsgBox "INVALID EMPLOYEE NUMBER ENTER NUMBER WITHOUT THE E", vbExclamation: Exit Sub
End If
With Sheets("PERMANENT BID")
Set Rg = .Columns(5).Find(EmpID, lookat:=xlWhole)
If Rg Is Nothing Then
MsgBox "EMPLOYEE NUMBER DOES NOT EXIST PLEASE TRY AGAIN", vbExclamation: Exit Sub
Else
Cells(Rg.Row, "D") = TextBox3
Cells(Rg.Row, "F") = TextBox4
Cells(Rg.Row, "E") = TextBox5
Cells(Rg.Row, "G") = TextBox6
End Sub
is there a way to use a shortcut like below
VBA Code:
'Set Rg = (.Cells(Rg.Row, "D").Resize(, 112))