名称管理器中的外部数据删除!如何简单这一点? VBA Excel
如何简化此代码以删除名称管理器中的externaldata_ *。名称管理器中的外部数据删除!如何简单这一点? VBA Excel
ActiveWorkbook.Names( “ExternalData_21”)。删除 ActiveWorkbook.Names( “ExternalData_22”)。删除 ActiveWorkbook.Names( “ExternalData_23”)。删除 ActiveWorkbook.Names( “ExternalData_24”)。删除 ActiveWorkbook.Names(“ExternalData_25”)删除 ActiveWorkbook.Names(“ExternalData_26”)。删除 ActiveWorkbook.Names(“ExternalData_27”)。删除 ActiveWorkbook.Names(“ExternalData_28”)。删除 ActiveWorkbook.Names(“ExternalData_29” “)。删除 ActiveWorkbook.Names(”ExternalData_30“)。删除 ActiveWorkbook.Names( “ExternalData_31”)。删除 ActiveWorkbook.Names( “ExternalData_32”)。删除 ActiveWorkbook.Names( “ExternalData_33”)。删除 ActiveWorkbook.Names( “ExternalData_34”)。删除 ActiveWorkbook.Names( “ExternalData_35”)。删除 ActiveWorkbook.Names( “ExternalData_36”)。删除 ActiveWorkbook.Names( “ExternalData_37”)。删除 ActiveWorkbook.Names( “ExternalData_38”)。删除 ActiveWorkbook.Names( “ExternalData_39”)。删除 ActiveWorkbook.Names(” ExternalData_40“)。删除
回答:
您可以试试这个...
Dim i As Long On Error Resume Next
For i = 21 To 40
ActiveWorkbook.Names("ExternalData_" & i).Delete
Next i
On Error GoTo 0
以上是 名称管理器中的外部数据删除!如何简单这一点? VBA Excel 的全部内容, 来源链接: utcz.com/qa/260845.html