Sub X()
    '在A1:A10000中尋找"Excel"
    Dim rngX As Range
    Set rngX = Worksheets("Sheet1").Range("A1:A10000").Find("Excel", lookat:=xlPart)
    If Not rngX Is Nothing Then
        MsgBox "Found at " & rngX.Address
    End If
     
End Sub
xlPart = looks at the text in the cell for any match.
xlWhole = looks at the entire/exact entry in the cell to see if it matches. 
=ADDRESS(MATCH(" Excel*",$A$1:$A$100,0),1)
https://www.udemy.com/blog/excel-vba-find/ 
Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte, SearchFormat)
LookAt (optional):  xlWhole and xlPart 
LookIn (optional): xlFormulas.
SearchOrder(optional): xlByRows or xlByColumns 
===============================================
Cells.Find(What:="24652", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
       xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
       , SearchFormat:=False).Activate
'找不到時,會出現「 執行階段錯誤 91: 物件變數或 with 區塊變數未設定 」 的錯誤
'----------------------------------------------------------------------------------------------------------------
MsgBox Cells.Find(What:="24652", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
       xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
       , SearchFormat:=False).Address
'找不到時,會出現「 執行階段錯誤 91: 物件變數或 with 區塊變數未設定 」 的錯誤
===============================================
searchstr = "123" 
Set obj = Cells.Find(What:=searchstr, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
       xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
       , SearchFormat:=False)
If obj Is Nothing Then
    MsgBox "找不到"
Else
   MsgBox obj.Offset(3).Value   '找到後,顯示向下3列的儲存格的資料值。
   MsgBox obj.Address    '顯示位址
    MsgBox obj.Column    '顯示行次(欄次)
   MsgBox obj.Row       '顯示列次
End If
==================================================== 
2014年2月25日 星期二
訂閱:
張貼留言 (Atom)
關節卡卡或彈響
關節間產生的潤滑液少,關節摩擦的損耗 髖關節彈響。 一般有兩種情況,第一種是關節外彈響較常見。 發生的主要原因是髂脛束的後緣或臀大肌肌腱部的前緣增厚, 在髖關節作屈曲、內收、內旋活動時,增厚的組織在大粗隆部前後滑動而發出彈響, 同時可見到和摸到一條粗而緊的縴維帶在...
- 
================== Range("A1").Select With Selection .HorizontalAlignment = xlLeft '水平對齊 .VerticalAlignment = xl...
 - 
儲存格 [R1C1]格式,[A1]格式 Cells(列次,欄次).Select Cells(2, "A").Select '2列A欄 Cells(2, 1).Select '2列1欄 Cells.Item(5,”C”...
 
您好:
回覆刪除想請問板主
假設我今天有幾筆資料 因為我的資料輸出為115ms 所以一秒會有八筆資料
A欄 B欄 C欄 D欄
2017/5/5 12:00:12 12 13
2017/5/5 12:00:12 13 14
2017/5/5 12:00:12 14 15
2017/5/5 12:00:12 15 16
2017/5/5 12:00:12 12 13
2017/5/5 12:00:12 13 14
2017/5/5 12:00:12 14 15
2017/5/5 12:00:12 15 16
2017/5/5 12:00:13 16 17
2017/5/5 12:00:12 17 18
.
.
.
有沒有辦法利用表單 輸入欄位 填入日期與時間 就可以讀取到C和D欄的值 再將二值做計算
但我的一秒會有八筆 可以抓取到任一筆做計算就好嗎
例如 輸入2017/5/5 12:00:12
12+13
輸出結果25
麻煩板主了