![]() |
trouble with advancedfilter of date column
Mustafa Kocaman; I have a problem such that; i have crated a userform which is t fill an order sheet namely "normal" . User enters the date in the dat fields in the form and other datas like "11.08.2005" then we have complete list of orders in "normal". İ wrote a macro to advanc filter the dates in a separete workshee but no results returned. On th other hand if i manually double-click a date cell and press enter th date becomes to be available for the filtering. i think i have to d something about the format of the date. what is your suggestions. thanks. filter macro code is ________________________________________________ Sub ApplyFilter() Dim wsDL As Worksheet Dim wsO As Worksheet Dim rngAD As Range Set wsDL = Sheets("normal") Set wsO = Sheets("Normal Tarih Sor") Set rngAD = wsDL.Range("B4:B100") wsDL.Range("A4:AC50000").AdvancedFilter _ Action:=xlFilterCopy, _ CriteriaRange:=wsO.Range("A1:B2"), _ CopyToRange:=wsO.Range("A6:AC500"), Unique:=True End Sub _________________________________________________ -- infested_t ----------------------------------------------------------------------- infested_tr's Profile: http://www.excelforum.com/member.php...fo&userid=2583 View this thread: http://www.excelforum.com/showthread.php?threadid=39225 |
trouble with advancedfilter of date column
The problem may be that when your code transfers the date from the form it
is now a String and not a number or a date. You must convert the text from the form into a date. -- steveB Remove "AYN" from email to respond "infested_tr" wrote in message ... Mustafa Kocaman; I have a problem such that; i have crated a userform which is to fill an order sheet namely "normal" . User enters the date in the date fields in the form and other datas like "11.08.2005" then we have a complete list of orders in "normal". İ wrote a macro to advance filter the dates in a separete workshee but no results returned. On the other hand if i manually double-click a date cell and press enter the date becomes to be available for the filtering. i think i have to do something about the format of the date. what is your suggestions. thanks. filter macro code is ________________________________________________ Sub ApplyFilter() Dim wsDL As Worksheet Dim wsO As Worksheet Dim rngAD As Range Set wsDL = Sheets("normal") Set wsO = Sheets("Normal Tarih Sor") Set rngAD = wsDL.Range("B4:B100") wsDL.Range("A4:AC50000").AdvancedFilter _ Action:=xlFilterCopy, _ CriteriaRange:=wsO.Range("A1:B2"), _ CopyToRange:=wsO.Range("A6:AC500"), Unique:=True End Sub __________________________________________________ -- infested_tr ------------------------------------------------------------------------ infested_tr's Profile: http://www.excelforum.com/member.php...o&userid=25839 View this thread: http://www.excelforum.com/showthread...hreadid=392257 |
trouble with advancedfilter of date column
Thanx STEVE ; İ got the problem now; but i can not figure out how to write a code to convert string inpu to a number (date). I have to insert the code somewhere in that portion of the codes. here is the userform code. Private Sub yenigiris_Click() Dim iRow As Long Dim ws As Worksheet Dim mycell As Range Set ws = Worksheets("Normal") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ ..End(xlUp).Offset(1, 0).Row 'check for a part number If Trim(Me.orderid.Value) = "" Then Me.orderid.SetFocus MsgBox "Bir Sipariş numarası girmelisiniz" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 1).Value = Me.orderid.Value ws.Cells(iRow, 2).Value = Me.date.Value |
trouble with advancedfilter of date column
I am not the best at doing this - but if you can send me a copy of your
workbook - I'll work on it and see if I can make it work. As for dates - using a calander control or using 3 ComboBoxes or Listboxes to select the date works fairly well for inputing dates. -- steveB Remove "AYN" from email to respond "infested_tr" wrote in message ... Thanx STEVE ; İ got the problem now; but i can not figure out how to write a code to convert string inpu to a number (date). I have to insert the code somewhere in that portion of the codes. here is the userform code. Private Sub yenigiris_Click() Dim iRow As Long Dim ws As Worksheet Dim mycell As Range Set ws = Worksheets("Normal") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row 'check for a part number If Trim(Me.orderid.Value) = "" Then Me.orderid.SetFocus MsgBox "Bir Sipariş numarası girmelisiniz" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 1).Value = Me.orderid.Value ws.Cells(iRow, 2).Value = Me.date.Value |
trouble with advancedfilter of date column
Dear, You can write the following code in textbox of date. Private sub txtdate_afterupdate() with txtVdate ..value = Formate (.value, "dd/mm/yyyy") End with End sub -- Syed Haider Ali ------------------------------------------------------------------------ Syed Haider Ali's Profile: http://www.excelforum.com/member.php...o&userid=21994 View this thread: http://www.excelforum.com/showthread...hreadid=392257 |
All times are GMT +1. The time now is 11:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com