Home > Excel Tutorial > Filtering Between Two Dates (Sort Dates & Remove Duplicates In Combobox )

Filtering Between Two Dates (Sort Dates & Remove Duplicates In Combobox )

      I made arrangements for the previous template. I’ve listed the dates on ComboBox , ascending order(it can sometimes be erratic.) I filled combobox with unique values from column.

When opened the userform , the dates  in the userform “A” column are sorted (ascending order). With following codes :

With pk.Range(“A2:D” & Cells(Rows.Count, “A”).End(xlUp).Row)
.Sort Key1:=Range(“A2”), _
Order1:=xlAscending, _
Header:=xlNo, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
End With

Then the combobox is filled with unique items.

combobox sort dates and remove duplicate items

 

You can Download Here

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: