VBA发现二义性名称错误,求热心大神,帮忙代码合并
PrivateSubWorksheet_SelectionChange(ByValTarget1AsRange)OnErrorGoToerror_handle'容错IfN...
Private Sub Worksheet_SelectionChange(ByVal Target1 As Range)
On Error GoTo error_handle '容错
If Not Intersect(Range("A38:A10000"), Selection) Is Nothing Then
ActiveWorkbook.SlicerCaches("切片器_关键词").VisibleSlicerItemsList = Array( _
"[关键词来源详情].[关键词].&[" & Target1 & "]")
End If
Exit Sub
error_handle:
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target4 As Range)
On Error GoTo error_handle '容错
If Not Intersect(Range("L5:L10000"), Selection) Is Nothing Then
ActiveWorkbook.SlicerCaches("切片器_搜索词").VisibleSlicerItemsList = Array( _
"[行业词].[搜索词].&[" & Target4 & "]")
End If
Exit Sub
error_handle:
End Sub 展开
On Error GoTo error_handle '容错
If Not Intersect(Range("A38:A10000"), Selection) Is Nothing Then
ActiveWorkbook.SlicerCaches("切片器_关键词").VisibleSlicerItemsList = Array( _
"[关键词来源详情].[关键词].&[" & Target1 & "]")
End If
Exit Sub
error_handle:
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target4 As Range)
On Error GoTo error_handle '容错
If Not Intersect(Range("L5:L10000"), Selection) Is Nothing Then
ActiveWorkbook.SlicerCaches("切片器_搜索词").VisibleSlicerItemsList = Array( _
"[行业词].[搜索词].&[" & Target4 & "]")
End If
Exit Sub
error_handle:
End Sub 展开
1个回答
展开全部
Private Sub Worksheet_SelectionChange(ByVal Target1 As Range)
On Error GoTo error_handle '容错
If Not Intersect(Range("A38:A10000"), Selection) Is Nothing Then
ActiveWorkbook.SlicerCaches("切片器_关键词").VisibleSlicerItemsList = Array( _
"[关键词来源详情].[关键词].&[" & Target1 & "]")
ElseIf Not Intersect(Range("L5:L10000"), Selection) Is Nothing Then
ActiveWorkbook.SlicerCaches("切片器_搜索词").VisibleSlicerItemsList = Array( _
"[行业词].[搜索词].&[" & Target4 & "]")
End If
error_handle:
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询