Code link:
Option Explicit
Sub Link2Sh()
With ActiveSheet
With Sheets(.Shapes(Application.Caller).AlternativeText)
.Visible = True: .Select
End With
.Visible = 2
End With
End Sub
Sub ShowAllShs()
Dim Sh As Worksheet
Application.ScreenUpdating = False
On Error Resume Next
With Sheet1.Shapes("All").TextFrame.Characters
For Each Sh In ThisWorkbook.Worksheets
If Sh.Name <> "Trang ch" & ChrW(7911) Then
Sh.Visible = .Text = "SHOW ALL"
End If
Next
.Text = IIf(.Text = "SHOW ALL", "HIDE ALL", "SHOW ALL")
End With
Application.ScreenUpdating = True
End Sub
Sub Test()
MsgBox AscW([I4])
End Sub
Code uniform
Option Explicit
Private Sub UserForm_Initialize()
Me.ListBox1.List() = GetSh
End Sub
Private Sub CommandButton1_Click()
Hide_UnHideSh False
End Sub
Private Sub CommandButton2_Click()
Hide_UnHideSh True
End Sub
Private Sub CommandButton3_Click()
Unload Me
End Sub
Private Sub Hide_UnHideSh(Check As Boolean)
Dim i As Long
On Error Resume Next
With Me.ListBox1
For i = 1 To .ListCount
If .Selected(i - 1) Then Sheets(.List(i - 1)).Visible = Check
Next
End With
End Sub
Private Function GetSh()
Dim Temp()
ThisWorkbook.Names.Add String(240, "z"), "=SUBSTITUTE(GET.WORKBOOK(1),""[""&GET.WORKBOOK(16)&""]"","""")"
Temp = Evaluate("Transpose(" & String(240, "z") & ")")
Temp = WorksheetFunction.Transpose(Temp)
ThisWorkbook.Names(String(240, "z")).Delete
GetSh = Temp
End Function
Code mo dun 2
Sub ShowForm()
UserForm1.Show
End Sub
Kính gửi Các Bác.
Em muốn tạo ribbon cho 1 số code trên
Các bác chỉ em với