Hi, chubbyjenz,
maybe try the workbook attached. I donīt think you should really start considering a Textbox to retrieve PO Numbers.
'ThisWorkbook
Private Sub Workbook_Open()
UserForm1.Show
End Sub
'behind UserForm1
Private Sub CancelBtn_Click()
Unload Me
End Sub
Private Sub cmdImport_Click()
Dim lngCC As Long
Dim lngRC As Long
With ActiveSheet
lngCC = 3 + Me.ComboBox1.ListIndex
tbdate.Value = .Cells(2, lngCC)
tbpono.Value = .Cells(3, lngCC)
For lngRC = 5 To 24
Controls("tb" & Format(lngRC - 4, "00")).Value = .Cells(lngRC, lngCC)
Next lngRC
End With
Me.cmdImport.Enabled = False
End Sub
Private Sub ComboBox1_Change()
Me.cmdImport.Enabled = Me.ComboBox1.ListIndex > 0
End Sub
Private Sub Submitbtn_click()
Dim lngRC As Long
Dim lngCC As Long
If Me.tbdate.Value = "" Then
MsgBox "Please Fill up Date.", vbExclamation, ""
Me.tbdate.SetFocus
Exit Sub
End If
If Me.tbpono.Value = "" Then
MsgBox "Please fill up P.O. number.", vbExclamation, ""
Me.tbpono.SetFocus
Exit Sub
End If
If Me.ComboBox1.ListIndex <= 0 Then
If MsgBox("Are you sure you want to add?", vbYesNo + vbQuestion, "Confirm?") = vbNo Then
For lngRC = 5 To 24
Controls("tb" & Format(lngRC - 4, "00")).Value = ""
Next lngRC
tbpono.Value = ""
tbdate.Value = Date
Exit Sub
End If
End If
If tbpono.Value = "" Then Exit Sub
With ActiveSheet
If Me.ComboBox1.ListIndex > 0 Then
lngCC = 3 + Me.ComboBox1.ListIndex
Else
lngCC = .Cells(2, .Columns.Count).End(xlToLeft).Column + 1
End If
.Cells(2, lngCC) = tbdate.Value
.Cells(3, lngCC) = tbpono.Value
For lngRC = 5 To 24
.Cells(lngRC, lngCC) = Controls("tb" & Format(lngRC - 4, "00")).Value
Controls("tb" & Format(lngRC - 4, "00")).Value = ""
Next lngRC
tbpono.Value = ""
End With
Me.ComboBox1.ListIndex = 0
UserForm_Activate
End Sub
Private Sub UserForm_Activate()
Dim lngCC As Long
Me.ComboBox1.Clear
Me.ComboBox1.AddItem "None"
For lngCC = 4 To ActiveSheet.Cells(3, Columns.Count).End(xlToLeft).Column
Me.ComboBox1.AddItem ActiveSheet.Cells(3, lngCC).Value
Next lngCC
Me.cmdImport.Enabled = False
End Sub
Private Sub UserForm_Initialize()
Me.tbdate = Date
End Sub
Private Sub tbpono_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'PO number format
If TypeName(Me.ActiveControl) = "TextBox" Then
With Me.ActiveControl
If Not IsNumeric(.Value) And .Value <> vbNullString Then
MsgBox "Sorry, ""The P.O. number"" only numbers allowed!", vbCritical, "oops"
.Value = vbNullString
.SetFocus
End If
End With
End If
End Sub
Private Sub tbdate_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'Date no format
If TypeName(Me.ActiveControl) = "TextBox" Then
With Me.ActiveControl
If Not IsDate(.Value) And .Value <> vbNullString Then
MsgBox "Sorry, it is not on date format!", vbCritical, "oops"
.Value = vbNullString
.SetFocus
End If
End With
End If
End Sub
You will have to play a bit with the form to understand how it works. 
Ciao,
Holger
Bookmarks