level 1
Windanccer
楼主
Sub 筛选最高分项()
Set endrng = Cells(2, Cells.Find("总分", lookat:=xlWhole))
Set t = Application.WorksheetFunction.CountA(Sheets("Sheet1 (2)").Columns(1))
Set r = Range(Cells(2, endrng), Cells(t, endrng))
maxx = Application.WorksheetFunction.Max(r)
For pos = 2 To Total
If Cells(pos, c).Value < maxm Then
Rows(pos).Select
End If
Next
End Sub
思路是目的是查出总分所在的列数,然后从第二列开始遍历每一行,删除列数低于最高值的。
但是各种报错,希望有大神帮忙看看
2018年04月30日 06点04分
1
Set endrng = Cells(2, Cells.Find("总分", lookat:=xlWhole))
Set t = Application.WorksheetFunction.CountA(Sheets("Sheet1 (2)").Columns(1))
Set r = Range(Cells(2, endrng), Cells(t, endrng))
maxx = Application.WorksheetFunction.Max(r)
For pos = 2 To Total
If Cells(pos, c).Value < maxm Then
Rows(pos).Select
End If
Next
End Sub
思路是目的是查出总分所在的列数,然后从第二列开始遍历每一行,删除列数低于最高值的。
但是各种报错,希望有大神帮忙看看