向右尋找最後一格有"畫格線"的儲存格 語法要怎寫
sub 123()
Dim L%
L = Range("A9").End(xlToRight).Borders.LineStyle
end sub
這樣好像不太對
请大大指教了^*^作者: kimbal 時間: 2012-7-18 22:05
本帖最後由 kimbal 於 2012-7-18 22:21 編輯
sub 123()
Dim L%
For Each c In Range(Range("A9"), Range("A9").End(xlToRight))
If c.Borders.LineStyle <> xlNone Then
L% = c
End If
Next
end sub
下面的複雜一些但會快少許
Sub test()
Dim L%
Dim i
With Range(Range("A9"), Range("A9").End(xlToRight))
For i = .Cells.Count To 1 Step -1
If .Cells(i).Borders.LineStyle <> xlNone Then
L% = .Cells(i)
Exit For
End If
Next
End With
End Sub作者: smouse0220 時間: 2012-7-31 23:43