Sub asd()
a = 34
For x = 1 To 4
**prev = Sheets("Sheet1").Cells(1, x - 1).Value**
this = Sheets("Sheet1").Cells(1, x).Value
**nex = Sheets("Sheet1").Cells(1, x + 1).Value**
If WorksheetFunction.Median(prev, this, nex) = a Then
MsgBox (x)
Else
End If
Next
End Sub
为什么粗体行不起作用。我也试过
prevnum = x-1
prev = Sheets("Sheet1").Cells(1, prevnum).Value
但它不起作用。