PC system date changes

DawnFMA

New Member
Joined
Jun 22, 2010
Messages
18
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.:confused: 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
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
The problem is here:

Code:
Date = InputBox(Prompt:="Enter Ship Date mm/dd/yyyy", Title:="Enter Ship Date mm/dd/yyyy")

Anytime you say "Date = ", it sets the system date to that value. You can fix this by changing "Date" to some other variable name like "MyDate". Just don't use "Date" by itself.
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,242
Members
452,898
Latest member
Capolavoro009

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top