I want to sort the column Reviews in descending and price in ascending but its not working, also is there a way to remove items if any of its data are incomplete. Im trying to make a dynamic data scraping based on user input and getting the best product.
Anil_G
(Anil Gorthi)
January 24, 2024, 8:00am
2
@darshanb.is22
Read the data…then use two sort datatable to sort both…or in excel also you have sort activity which works as well
To remove rows…simply use filter datatable and filter for empty rows
Or if needed on excel use a combination of filter and delete rows
Cheers
vrdabberu
(Varunraj Dabberu)
January 24, 2024, 8:04am
3
Hi @darshanb.is22
Please check the below thread
Hi @darshanb.is22
Sequence:
Main.xaml (14.6 KB)
Macros Code:
Sub FilterData()
Dim ws As Worksheet
Dim lastRow As Long
Dim sortRange As Range
' Set the worksheet
Set ws = ThisWorkbook.Sheets("Sheet1") ' Replace "Sheet1" with your actual sheet name
' Find the last row in the data
lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
' Define the range to be sorted (assuming data starts from A1)
Set sortRange = ws.Range("A1:D" & lastRow)
…
Regards
1 Like