excel 如何选中区域,区域中最大值,最小值,第二大值,第二小指,变颜色,最好用VBA
答案:2 悬赏:0 手机版
解决时间 2021-03-06 07:32
- 提问者网友:ミ烙印ゝ
- 2021-03-05 14:15
excel 如何选中区域,区域中最大值,最小值,第二大值,第二小指,变颜色,最好用VBA
最佳答案
- 五星知识达人网友:街头电车
- 2021-03-05 15:50
Sub d()
UsedRange.Select
Range("a5") = "max"
maxzhi = Application.WorksheetFunction.Max(UsedRange)
Set c = UsedRange.Find(maxzhi, LookIn:=xlValues)
If Not c Is Nothing Then
c.Interior.Color = RGB(255, 0, 0)
End If
maxzhi = maxzhi - 1
Set c = UsedRange.Find(maxzhi, LookIn:=xlValues)
If Not c Is Nothing Then
c.Interior.Color = RGB(255, 255, 0)
End If
maxzhi = Application.WorksheetFunction.Min(UsedRange)
Set c = UsedRange.Find(maxzhi, Lookat:=xlWhole)
If Not c Is Nothing Then
c.Interior.Color = RGB(0, 255, 0)
End If
maxzhi = maxzhi + 1
Set c = UsedRange.Find(maxzhi, Lookat:=xlWhole)
If Not c Is Nothing Then
c.Interior.Color = RGB(0, 255, 255)
End If
End Sub
UsedRange.Select
Range("a5") = "max"
maxzhi = Application.WorksheetFunction.Max(UsedRange)
Set c = UsedRange.Find(maxzhi, LookIn:=xlValues)
If Not c Is Nothing Then
c.Interior.Color = RGB(255, 0, 0)
End If
maxzhi = maxzhi - 1
Set c = UsedRange.Find(maxzhi, LookIn:=xlValues)
If Not c Is Nothing Then
c.Interior.Color = RGB(255, 255, 0)
End If
maxzhi = Application.WorksheetFunction.Min(UsedRange)
Set c = UsedRange.Find(maxzhi, Lookat:=xlWhole)
If Not c Is Nothing Then
c.Interior.Color = RGB(0, 255, 0)
End If
maxzhi = maxzhi + 1
Set c = UsedRange.Find(maxzhi, Lookat:=xlWhole)
If Not c Is Nothing Then
c.Interior.Color = RGB(0, 255, 255)
End If
End Sub
全部回答
- 1楼网友:零点过十分
- 2021-03-05 16:03
可以私聊我~
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯