返回列表 上一主題 發帖

[發問] 選取大於某數的值

用VBA如下

Sub TEST()
Sheet1.[B2:IV65536].ClearContents
X = Sheet1.Cells(1, Columns.Count).End(xlToLeft)
Y = Sheet1.Cells(2, Columns.Count).End(xlToLeft)
For M = 2 To X
If Sheet1.Cells(1, M) - 9 > 0 Then
  Sheet1.Cells(2, Y + 1) = Sheet1.Cells(1, M)
    Y = Y + 1
  End If
  Next
End Sub

TOP

        靜思自在 : 屋寬不如心寬。
返回列表 上一主題