我有一个.find
命令有问题。我想创建一个宏与find
命令找到一个特定的细胞后复制范围并将其粘贴(偏移到活动单元格移动到数据值):使用excel查找时间序列号
Sub value()
Dim today As String
Dim lookfor As Range
Sheets(1).Range("C3:C19").Copy
today = "11.nov"
Set lookfor = Cells.Find(What:=today, _
After:=ActiveCell, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False).Activate
lookfor.Offset(rowOffset:=1, columnOffset:=3).Paste
End Sub
您的代码似乎这样的伎俩,只是改变'otsitav.Offset(...)''来lookfor.Offset(...) – R3uK
这是'翻译错误。对不起,但代码仍然给出错误nr91:Object variable或With block variable not set。我试图让工作簿成为一个对象,但它仍然给出了错误 –
摆脱'SetFile'末尾的'.Activate',你的代码应该正常工作! ;) – R3uK