返回列表 上一主題 發帖

[發問] 欄位貼上問題

回復 2# GBKEE


    測試.rar (47.71 KB)

抱歉 夾帶錯檔案 這個才對

TOP

回復 2# GBKEE

謝謝版主回答~~
那我可以在請問一下
Set A = .Range("A2", .[a2].End(xlDown)).Find(what:=a_date, LookIn:=xlValues) '搜尋文字

這個範圍部分的 "A2", .[a2].End(xlDown))用法嗎

以及button1和2的差別

測試.rar (43.63 KB)
我將搜尋到的資料 貼到sheet1的第三列開始
是哪裡的寫法錯誤
讓他無止盡的貼下去
而且sheet2的品名#702 也就是第一項沒有貼到??

不好意思問題很多><

TOP

回復 1# bridetobe
  1. Private Sub CommandButton1_Click()
  2.     Dim a_date  ' As String
  3.     a_date = InputBox("輸入日期(例2014/7/1):")
  4.     With Sheet2
  5.         Set A = .Range("A2", .[a2].End(xlDown)).Find(what:=a_date, LookIn:=xlValues) '搜尋文字
  6.     End With
  7.     If Not A Is Nothing Then
  8.         MsgBox ("有")
  9.     Else
  10.         MsgBox ("沒有資料")
  11.     End If
  12. End Sub
  13. Private Sub CommandButton2_Click()
  14.     Dim a_date As Date
  15.     a_date = InputBox("輸入日期(例2014/7/1):")
  16.     With Sheet2
  17.         Set A = .Range("A2", .[a2].End(xlDown)).Find(what:=a_date, LookIn:=xlFormulas) '搜尋公式
  18.     End With
  19.     If Not A Is Nothing Then
  20.         MsgBox ("有")
  21.     Else
  22.         MsgBox ("沒有資料")
  23.     End If
  24. End Sub
複製代碼
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

日期的搜尋方法

想請問日期的搜尋方法
是不是跟一般搜尋不太一樣?

Book1.rar (43.62 KB)

問題:
按下讀出 輸入日期 的日期格式應該是要怎麼樣
ex打入2014/7/1 會將sheet2的7/1的所有資料都更新至Sheet1第三列開始

所以想問日期的搜尋方法是怎麼做

TOP

        靜思自在 : 手心向下是助人,手心向上是求人;助人快樂,求人痛苦。
返回列表 上一主題