regarding creating search box by date

tarik mokhtar 21 Reputation points
2022-05-30T08:09:48.5+00:00

dear all,
good greeting
i need to add a search box by date to my userform this is the code i need to add to it

Dim Litem As Long, LbRows As Long, LbCols As Long
Dim bu As Boolean
Dim Lbloop As Long, Lbcopy As Long

LbRows = ListBox1.ListCount - 1
LbCols = ListBox1.ColumnCount - 1

For Litem = 0 To LbRows
If ListBox1.Selected(Litem) = True Then
bu = True
Exit For
End If
Next
If bu = True Then
With Sheets("SelectedData").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)

     For Litem = 0 To LbRows
         If ListBox1.Selected(Litem) = True Then 'Row selected
           'Increment variable for row transfer range
           Lbcopy = Lbcopy + 1
     For Lbloop = 0 To LbCols
                'Transfer selected row to relevant row of transfer range
     .Cells(Lbcopy, Lbloop + 1) = ListBox1.List(Litem, Lbloop)

    Next Lbloop
         End If
     Next
     For M = 0 To LbCols
         With Sheets("SelectedData").Cells(Rows.Count, 1).End(xlUp).Offset(0, M).Borders(xlEdgeBottom)
 .LineStyle = xlContinuous
 .Weight = xlMedium
 .ColorIndex = 30


 Dim WS As Worksheet

Set WS = Sheets("SelectedData")
Dim rowRng As Range
For Each rowRng In WS.UsedRange.Rows
BlanckCellsCount = WorksheetFunction.CountBlank(rowRng)
If BlanckCellsCount <> rowRng.Cells.Count Then
With rowRng
.Borders.Weight = xlThick
.Cells.VerticalAlignment = xlCenter
.Cells.HorizontalAlignment = xlCenter
End With
End If
Next rowRng

 End With

Next
End With

Else
MsgBox "Nothing chosen", vbCritical
Exit Sub

End If
Sheet3.Range("a:i").Cells.Font.Size = 40
Sheet3.Range("a:i").WrapText = True
Sheet3.Range("a:i").Cells.HorizontalAlignment = True

Sheet3.Range("A:I").ExportAsFixedFormat xlTypePDF, Filename:="TEST", OPENAFTERPUBLISH:=True

MsgBox "تم أنشاء التقرير", vbInformation
ListBox1.Clear

End Sub

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,459 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,638 questions
{count} votes