Hi Alex, welcome to the forum. Going the macro route there are several options:
1. Filter the list in place (hide the rows with countries having 0 people)
2. Filter the list to another location, then clear the original info and paste the filtered list in its place
3. Delete the rows in which people is 0.
2 and 3 produce the same results, just different methods of doing so. Here are examples of all 3:
1. Filter the list in place:
Sub Macro1()
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("$A$1:$B$" & LR).AutoFilter Field:=2, Criteria1:=">0", Operator:=xlAnd
End Sub
2. Advanced Filter, overwrite original list with filtered data. This uses columns C, D and E to hold the temporary criteria and filtered data.
Sub Macro2()
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("C1").Value = "People"
Range("C2").Value = ">0"
Range("A1:B" & LR).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("C1:C2"), CopyToRange:=Range("D1:E1"), Unique:=False
Columns("A:C").Delete Shift:=xlToLeft
End Sub
3. Delete rows containing 0's in column B:
Sub Macro3()
Dim LR As Long, i as Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
If Cells(i, 2).Value = 0 Then Cells(i, 2).EntireRow.Delete
Next i
End Sub
Hope that helps!
Bookmarks