View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
neowok[_19_] neowok[_19_] is offline
external usenet poster
 
Posts: 1
Default converting date from a textbox to a date format

just tried that but isnt working, code i used was

Private Sub CommandButton4_Click()
Dim mydatestr As String
mydatestr = Format(CDate(TextBox2.value), "dd-mmm-yyyy")
Range("J23").Value = mydatestr
Me.Range("mytables").AutoFilter 6, mydatestr, _
Operator:=xlAnd
End Sub

only way ive got it to return a result so far is by

Me.Range("mytables").AutoFilter 6, cdate(textbox2.text), _
Operator:=xlAnd but i had to convert the column to the first dat
format *dd/mm/yyyy which seems to be what cdate converts to

--
Message posted from http://www.ExcelForum.com