Sub search()
Columns("J:K").Select
Selection.EntireColumn.Hidden = False
ActiveSheet.PivotTables("PivotTable15").PivotSelect "device[All]", xlLabelOnly _
+ xlFirstRow, True
Cells.Find(What:=InputBox("Please enter the PartID", "Search"), _
After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
ActiveCell.Offset(0, 1).Select
Selection.ShowDetail = True
Selection.Copy
Sheets("interface").Select
Range("L501").Select
ActiveSheet.Paste
Columns("J:K").Select
Selection.EntireColumn.Hidden = True
Range("A2").Select
End Sub
我的子按钮上有这段代码,但是当我取消显示的输入框时出现错误。错误是:“无法设置 Range 类的 ShowDetail 属性”。突出显示的错误是:
Selection.ShowDetail = True