客户编号中设置了VBA代码,点击链接后显示客户信息,返回目录后自动隐藏。但是超链接无法编辑,点击确定后,显示下标越界,改怎么修改超链接或者VBA代码。
目录表的代码:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) Sheets(Target.Name).Visible = xlSheetVisible Sheet1.Visible = xlSheetVeryHiddenEnd Subsheet2代码:
Private Sub CommandButton1_Click() Sheet1.Visible = xlSheetVisible Sheet2.Visible = xlSheetVeryHiddenEnd Subworkbook代码:
Private Sub Workbook_SheetActivate(ByVal sh As Object) With Sheets("目录表") m = 0 For i = 1 To Sheets.Count 'SubAddress:=Sheets(i).Range("b1").Address, If Sheets(i).Name <> "目录表" Then m = m + 1 End If Next i End WithEnd Sub模块1代码:
Sub Macro3() With Sheets("目录表") m = 0 For i = 1 To Sheets.Count 'SubAddress:=Sheets(i).Range("b1").Address, If Sheets(i).Name <> "目录表" Then m = m + 1
End If Next i End WithEnd SubSub auto_open() Dim i As Integer For i = 1 To Sheets.Count If i = 1 Then Sheets(i).Visible = xlSheetVisible Else Sheets(i).Visible = xlSheetVeryHidden End If Next iEnd Sub