為什麼這篇vba value用法鄉民發文收入到精華區:因為在vba value用法這個討論話題中,有許多相關的文章在討論,這篇最有參考價值!作者spce (Diablo)看板Office標題[問題] 關於Excel VBA 搜尋符合條件的儲...
Worksheets("Sheet2").Select
Cells.Find(What:="關鍵字1", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, MatchByte:=False, SearchFormat:=False).Activate
Range(Worksheets("Sheet2").Cells(data_long, 3), Worksheets("Sheet2").Cells(data
_long, 10)).Copy
Worksheets("Sheet1").Select
Worksheets("Sheet1").Cells(i, 2).Select
ActiveSheet.Paste
Application.CutCopyMode = False
data_long = 0
---------------------------------------------------------
Worksheets("Sheet2").Select
Cells.Find(What:="關鍵字2", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, MatchByte:=False, SearchFormat:=False).Activate
'
Range(Worksheets("Sheet2").Cells(data_fix, 3), Worksheets("Sheet2").Cells(data
_fix, 10)).Copy
Worksheets("Sheet1").Select
Worksheets("Sheet1").Cells(i, 10).Select
ActiveSheet.Paste
Application.CutCopyMode = False
data_long = 0
------------------------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Value = "關鍵字1" Then data_long = Target.Row
If ActiveCell.Value = "關鍵字2" Then data_fix = Target.Row
End Sub
這個語法..第一部份是在Sheet2找"關鍵字1"
比如說 此關鍵字是在B15
然後把C3到J15選取複製貼到Sheet1的某位置
請問其中Cells(date_long,3)代表什麼意思?
相同的第二部份也有..Cells(data_fix, 3)
這種用法是???
謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 124.6.13.220
※ 編輯: spce 來自: 124.6.13.220 (06/26 23:33)