返回列表 上一主題 發帖

FIND 的用法 ??

FIND 的用法 ??

我想找 V6:V84 倒數第1個 不等於0 的值
Set b = Range("v6:v84").Find(What:=???, SearchOrder:=xlByRows, LookIn:=xlValues, SearchDirection:=xlPrevious, LookAt:=xlWhole)

回復 1# t8899
FIND 沒有此能力
  1. Option Explicit
  2. Sub Ex()
  3.     Dim i As Integer, b As Range
  4.     With Range("v6:v84")
  5.         For i = .Rows.Count To 1 Step -1
  6.             If IsNumeric(.Cells(i)) And .Cells(i) > 0 Then
  7.                 Set b = .Cells(i)
  8.                 Exit For
  9.             End If
  10.         Next
  11.     End With
  12. End Sub
複製代碼
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

Sub Macro2()
Dim b As Range
With Range("v6:v84")
     .NumberFormatLocal = "||;||;0"
     Set b = .Find(What:="||", LookIn:=xlValues, SearchDirection:=xlPrevious, LookAt:=xlWhole)
     .NumberFormatLocal = "G/通用格式"
     If Not b Is Nothing Then MsgBox b.Address
End With
End Sub

TOP

        靜思自在 : 看別人不順眼,是自己修養不夠。
返回列表 上一主題