Code: Select all
Set sCell = ("datarange")
Code: Select all
=OFFSET(Data!$A$2,0,0,COUNTA(Data!$A:$A),7)
Code: Select all
Set sCell = ("datarange")
Code: Select all
=OFFSET(Data!$A$2,0,0,COUNTA(Data!$A:$A),7)
adam wrote:Thanks for the help Hans. Finally the code highlights the duplicate values from the list box. But why doesn't the highlighted rows get filtered in the list box same as in the worksheet? so that it would make the user to view only the highlighted rows.
Based upon the above quotes, I have added a list box2 to my user form in order to view the filtered data or the duplicate rows that are filtered by the code. Moreover, I have added a new button to the form with the name “Search Dupsâ€.HansV wrote:A list box whose RowSource is a range doesn't work that way: even if some of the rows in the range are hidden, they remain visible in the list box. You can't hide items in a list box.
Code: Select all
Data = Sheets("Data").Range("A1").CurrentRegion.Offset(1)
I've tried by adding the lineHansV wrote:
or similar - see the workbook(s) that you attached to the thread Filter Data In User Form. You did declare the variable Data there, but apparently you forgot to copy the relevant line of code.