Sub testIsVaildGeo()
Dim shs As Object
Set shs = Sheets(1)
Dim row As Integer
Dim Lng As Integer
Dim Lat As Integer
row = 3
Lng = 4
Lat = 5
Do
With shs.Cells(row, Lat)
If .Value < 0 Or .Value > 90 Then
.Font.Color = RGB(255, 0, 0)
Else
.Font.Color = RGB(0, 0, 0)
End If
End With
row = row + 1
Loop Until IsEmpty(shs.Cells(row, Lat))
row = 3
Do
With shs.Cells(row, Lng)
If .Value < 0 Or .Value > 180 Then
.Font.Color = RGB(255, 0, 0)
Else
.Font.Color = RGB(0, 0, 0)
End If
End With
row = row + 1
Loop Until IsEmpty(shs.Cells(row, Lng))
End Sub
VBA Excel
最新推荐文章于 2024-07-17 22:03:04 发布