date format problem??
- From: Steve <instructorf@xxxxxxxxxxx>
- Date: Thu, 27 Dec 2007 12:22:34 -0800 (PST)
Hi there, hope you can help with this,,,
am using the code below with few problems,
the following line is showing in my spread*** as "TRUE" rather than
the date that gets entered
ws.Cells(iRow, 2).Value = Me.TextBox2.Value = Format(Date, "dd/mm/yy")
any help would be appreciated
Steve
Private Sub cmdadd_Click()
Dim iRow As Long
Dim ws As Work***
Set ws = Worksheets("Lesson1")
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
If Trim(Me.TextBox1.Value) = "" Then
Me.TextBox1.SetFocus
MsgBox "Please enter an Amount"
Exit Sub
End If
ws.Cells(iRow, 1).Value = Me.TextBox1.Value
ws.Cells(iRow, 2).Value = Me.TextBox2.Value = Format(Date, "dd/mm/yy")
ws.Cells(iRow, 3).Value = Me.TextBox3.Value
ws.Cells(iRow, 5).Value = Me.TextBox4.Value
ws.Cells(iRow, 6).Value = Me.TextBox5.Value
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.TextBox4.Value = ""
Me.TextBox5.Value = ""
Me.TextBox1.SetFocus
Unload Me
End Sub
.
- Follow-Ups:
- Re: date format problem??
- From: Dave Peterson
- Re: date format problem??
- Prev by Date: RE: lock cells based on interior color
- Next by Date: Re: Creates new file when opening in windows explorer
- Previous by thread: RE: lock cells based on interior color
- Next by thread: Re: date format problem??
- Index(es):