yamihero777
New Member
Hello Excel gurus,
Trying to create an Serious Userform which could reduce 2hr work to 20 mins. This is part of my project which i'm very much stuck
Objective : Get data from a certain column if given date (userform) between given date -14 days
1. of Course there is unique value if got matched then given date then get data
2. Only unique value but multiple dates different sells values
3. 14 days is constant . between 14 days if unique value got sale again fetch date value .
4. i'm one of there employee, not a professional excel guru's . Help me my colleagues from deadly working hours.
Got this from one of the forms. but no luck. i'm getting type mismatch error sub_date = date_ref - 14
>>> use code - tags <<<
Please reply for any more information .
Trying to create an Serious Userform which could reduce 2hr work to 20 mins. This is part of my project which i'm very much stuck
Objective : Get data from a certain column if given date (userform) between given date -14 days
1. of Course there is unique value if got matched then given date then get data
2. Only unique value but multiple dates different sells values
3. 14 days is constant . between 14 days if unique value got sale again fetch date value .
4. i'm one of there employee, not a professional excel guru's . Help me my colleagues from deadly working hours.
Got this from one of the forms. but no luck. i'm getting type mismatch error sub_date = date_ref - 14
>>> use code - tags <<<
Code:
Sub LastRemark()
Dim date_ref, sub_date As Date
Dim datesheet As Worksheet
Set datesheet = Worksheets("AllTaskDump")
date_ref = Trim(MIAform.dateBox.Text)
sub_date = date_ref - 14
date_ref = format(date_ref, "dd-mm-yyyy")
sub_date = format(sub_date, "dd-mm-yyyy")
With datesheet
If .FilterMode Then .ShowAllData
.Range("AD:AD").AutoFilter Field:=1, Criteria1:=">=" & sub_date, Operator:=xlAnd, Criteria2:="<=" & date_ref
MIAform.lastBox.Text = .Range("Q:Q").SpecialCells(xlCellTypeVisible).Value
MIAform.rptBox.Text = "yes"
End With
End Sub
Last edited by a moderator: