Soru Kodda Ufak Düzeltme Yardım

Katılım
23 Eylül 2017
Mesajlar
43
Excel Vers. ve Dili
2016
Altın Üyelik Bitiş Tarihi
02-07-2022
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

Dim syf As String

On Error GoTo Son

If Intersect(Target, Range("F5:F" & Rows.Count)) Is Nothing Then Exit Sub

syf = Target.Value
If syf <> "" Then Sheets(syf).Select
Exit Sub

Son:

MsgBox "Sayfayı Bulamadım", , "excel.web.tr"
Target.Offset(1, 0).Select

End Sub

merhaba bu kod hücreye sayfa ismini yazıyorsun ve o sayfaya gidiyor
sayfa gizli olunca kod sayfayı bulamıyor
sizden ricam bu koda eğer sayfa gizliyse sayfayı açmasını ve kodların çalışmasını sağlıycak bir komut eklemeniz
 

AdemCan

Altın Üye
Destek Ekibi
Katılım
1 Eylül 2008
Mesajlar
1,363
Excel Vers. ve Dili
2019 TR
Merhaba

If syf <> "" Then Sheets(syf).Select satırını aşağıdaki şekilde değiştiriniz.

Kod:
If syf <> "" Then
    Sheets(syf).Visible = True
    Sheets(syf).Select
End If
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
41,587
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Alternatif;

C++:
Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Dim S1 As Worksheet
    
    If Intersect(Target, Range("F5:F" & Rows.Count)) Is Nothing Then Exit Sub
    Cancel = True
    
    On Error Resume Next
    Set S1 = Nothing
    Set S1 = Sheets(Target.Text)
    On Error GoTo 0
    
    If Not S1 Is Nothing Then
        If S1.Visible = xlSheetHidden Then
            S1.Visible = xlSheetVisible
            S1.Select
        Else
            S1.Select
        End If
    Else
        MsgBox "Sayfa bulunamadı!", vbCritical
    End If

    Set S1 = Nothing
End Sub
 
Üst