【发布时间】:2022-11-30 04:53:15
【问题描述】:
我有一个当前查找包含单词“有效日期”的单元格,它基本上是我正在循环的列表的列标题(恰好从单元格 E24 开始)。我想抓住我所在的当前位置来开始我的循环,而不是硬编码 i = 24 到 200(所以 24 应该是当前单元格)。我该怎么做呢?下面是我的循环
' Find beginning of list of specification files
Range("A1").Select
Cells.Find(What:="Effective Date", After:=ActiveCell, LookIn:=xlFormulas2 _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(2, 0).Select
Dim i
Dim Folder
For i = 24 To 200
If IsEmpty(Range("E" & i).Value) Or IsEmpty(Range("G" & i).Value) Then
' do nothing
Else
Range("G" & i).Select
Folder = ActiveCell
Call ListFilesInFolder(Folder, DestinationLoc)
End If
Next i
End Sub
【问题讨论】: