I created a user form and it works great EXCEPT when the user enters a ship date the system date on their PC changes to that date. Any suggestions??
Private Sub cbOK_Click()
'Turn Off Filter
Cells(1, 1).AutoFilter
'Report Criteria
If Me.obCust.Value = True Then
CustCode = InputBox(Prompt:="Enter Customer Code", Title:="Enter Cust Code")
ActiveCell.Columns("B:B").EntireColumn.Select
ActiveSheet.Range("$B$1:$B$65536").AutoFilter Field:=1, Criteria1:=CustCode
Cells(1, 2).Select
ElseIf Me.obItem.Value = True Then
Item = InputBox(Prompt:="Enter Item #", Title:="Enter Item #")
ActiveCell.Columns("G:G").EntireColumn.Select
ActiveSheet.Range("$G$1:$G$65536").AutoFilter Field:=1, Criteria1:=Item
Cells(1, 7).Select
ElseIf Me.obLot.Value = True Then
Lot = InputBox(Prompt:="Enter Lot #", Title:="Enter Lot # (with 3 leading zeros)")
ActiveCell.Columns("J:J").EntireColumn.Select
ActiveSheet.Range("$J$1:$J$65536").AutoFilter Field:=1, Criteria1:=Lot
Cells(1, 10).Select
'ISSUE:
ElseIf Me.obDate.Value = True Then
Date = InputBox(Prompt:="Enter Ship Date mm/dd/yyyy", Title:="Enter Ship Date mm/dd/yyyy")
ActiveCell.Columns("E:E").EntireColumn.Select
ActiveSheet.Range("$E$1:$E$65536").AutoFilter Field:=1, Criteria1:=Date
Cells(1, 5).Select
End If
'Unload Form
Unload Me
End Sub
Private Sub cbCancel_Click()
Unload Me
'Turn Off Filter
Cells(1, 1).AutoFilter
'Turn ON Filter
Cells(1, 1).AutoFilter
End Sub
Private Sub obDate_Click()
End Sub
Private Sub cbOK_Click()
'Turn Off Filter
Cells(1, 1).AutoFilter
'Report Criteria
If Me.obCust.Value = True Then
CustCode = InputBox(Prompt:="Enter Customer Code", Title:="Enter Cust Code")
ActiveCell.Columns("B:B").EntireColumn.Select
ActiveSheet.Range("$B$1:$B$65536").AutoFilter Field:=1, Criteria1:=CustCode
Cells(1, 2).Select
ElseIf Me.obItem.Value = True Then
Item = InputBox(Prompt:="Enter Item #", Title:="Enter Item #")
ActiveCell.Columns("G:G").EntireColumn.Select
ActiveSheet.Range("$G$1:$G$65536").AutoFilter Field:=1, Criteria1:=Item
Cells(1, 7).Select
ElseIf Me.obLot.Value = True Then
Lot = InputBox(Prompt:="Enter Lot #", Title:="Enter Lot # (with 3 leading zeros)")
ActiveCell.Columns("J:J").EntireColumn.Select
ActiveSheet.Range("$J$1:$J$65536").AutoFilter Field:=1, Criteria1:=Lot
Cells(1, 10).Select
'ISSUE:
ElseIf Me.obDate.Value = True Then
Date = InputBox(Prompt:="Enter Ship Date mm/dd/yyyy", Title:="Enter Ship Date mm/dd/yyyy")
ActiveCell.Columns("E:E").EntireColumn.Select
ActiveSheet.Range("$E$1:$E$65536").AutoFilter Field:=1, Criteria1:=Date
Cells(1, 5).Select
End If
'Unload Form
Unload Me
End Sub
Private Sub cbCancel_Click()
Unload Me
'Turn Off Filter
Cells(1, 1).AutoFilter
'Turn ON Filter
Cells(1, 1).AutoFilter
End Sub
Private Sub obDate_Click()
End Sub