標題:
[發問]
此巨集如何寫??
[打印本頁]
作者:
t8899
時間:
2013-1-30 20:21
標題:
此巨集如何寫??
e20到e200 為公式如下
e20=IF(Y20="","",Y20/(y20-z20))
e21=IF(Y21="","",Y21/(y21-z21))
.....
...
要移到e20到e200 之間
倒數第一筆
"不等於空白"
的儲存格
巨集如何寫?
作者:
t8899
時間:
2013-1-30 20:32
更改一下
是mouse 要移到e20到e200 之間倒數第一筆"不等於空白"的儲存格
作者:
kimbal
時間:
2013-1-30 22:11
回復
2#
t8899
Sub TEST1()
firstaddress = ""
With Selection
If .Cells(1, 1) = "" Then
firstaddress = .Cells(1, 1).Address
lastAddress = firstaddress
End If
Set c = .Find("", LookIn:=xlValues)
If Not c Is Nothing Then
If firstaddress = "" Then
firstaddress = c.Address
End If
lastAddress = firstaddress
Do
Set c = .FindNext(c)
If Not c Is Nothing And c.Address <> firstaddress Then
lastAddress = c.Address
End If
Loop While Not c Is Nothing And c.Address <> firstaddress
End If
End With
MsgBox (lastAddress)
End Sub
複製代碼
作者:
t8899
時間:
2013-1-31 06:28
回復 t8899
kimbal 發表於 2013-1-30 22:11
謝謝!
這是另一個答案提供參考
Range("e" & [e20:e200].Find("*", SearchOrder:=xlByRows, LookIn:=xlValues, _
SearchDirection:=xlPrevious).EntireRow.Row).Select
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)