Sub tim_sheet()
Dim Tieude As String
Dim Timduoc As Boolean
Dim I As Integer, sosheet As Long
Dim TenSheet As String
Tieu de = "
www.giaiphapexcel.com"
sosheet = ActiveSheet.Sheets.Count 'xac dinh so sheet trong workbook'
timtiep:
Tensheet=lcase(application.inputbox("Ban go ten cua sheet:",Tieude)
If TenSheet = "False" Then Exit Sub 'neu nguoi dung bam cancel
If TenSheet = "" Then
MsgBox "ban hay nhap ten sheet de tim:", vbExclamation, Tieude
GoTo timtiep 'quaytro lai nhan tim tiep
End If
Timduoc = False
For I = 1 To sosheet
If InStr(1, LCase(Sheets(I).Name), TenSheet) > 0 Then
Timduoc = True
Sheets(I).Select
If Msgbox ("Da tim duoc sheet co ten""""&TenSheet&""".Ban cos muon tim tiep khong?",vbYesNo+vbQuestion,Tieude)=vbYes Then Goto Timtiep
Exit For
End If
Next 'Neu khong tim duoc sheet
If Not Timduoc Then
msgbox " Khong tim thay sheet co ten """ & Tensheet&""",",vbExclamation, Tieude
endsub
Em không hiểu lắm ở phần nhãn Timtiep, cách thức tạo một nhãn như vậy, công dụng anh chị giải đáp giúp em với ạ, e cám ơn